In this tutorial, we are going to learn about how to split the comma-separated string into an array in PHP
We can split the comma (
,) separated string to an array by using the built-in
explode() function in PHP.
Here is an example, that splits the comma delimited string into an array of strings:
$user = "1,rashi,firstname.lastname@example.org"; $userArray = explode(',', $user); print_r($userArray);
Array (  => 1  => rashi  => email@example.com )