Convert comma separated string into array

Convert comma separated string into array  we need to use explode php function

Example Below : 
$myString = “15,,sainidaya”;
$myArray = explode(‘,’, $myString);


[0] => 15
[1] =>
[2] => sainidaya

How explode function works :
The explode() function breaks a string into an array.

Note: “Separator” parameter cannot be an empty String.

Syntax of explode


I hope you like this Post, Please feel free to comment below, your suggestion and problems if you face – we are here to solve your problems.

I, Dayanand Saini,the founder and chief editor of,have been working as a software engineer from last 4+ years. It's my hobby to learn new things and implement on live environment.

Leave a Reply

Your email address will not be published. Required fields are marked *

46 + = 54

%d bloggers like this: