Fix NOTICE: undefined offset: 1

Fixed the PHP notice: undefined offset: 1 in the explode by using array_pad.