php string to array
snippet in php

explode comma php

user7895

$myString = "9,admin@example.com,8";
$myArray = explode(',', $myString);
print_r($myArray);

php split string

user1638

<?php
// It doesnt get any better than this Example
$pizza  = "piece1 piece2 piece3 piece4 piece5 piece6";
$pieces = explode(" ", $pizza);
echo $pieces[0]; // piece1
echo $pieces[1]; // piece2

php split string

user6867


<?php

$str = "Hello world. It's a beautiful day.";

print_r (explode(" ",$str));

?> 

string to array php

user4778

explode(" ","Geeks for Geeks")