How To Convert Delimited String Into Array

PHP has explode function to split string by string into an array. So basically we can turn string pattern like this a,b,c,d into one array data. See example below how to convert delimited string into array data.

You can see there’s two parameters above (actually 3, see PHP explode). First parameter is for delimiter character, and second parameter is for string that we want to convert.

Caution !
Delimiter parameter cannot be an empty string (“”), explode() function will return FALSE if you do that. Also if you speified delimiter that not exists in string, then an empty array will be returned, otherwise an array containing string will be returned.