You have to split the string by delimiter(, in this case). One of the best-known methods is using preg_split function which splits the string by specified delimiter and returns the split string as elements of an array.
<?php
$x = "1, 2, 3, 4, 5, 6, 7, 8, 9, 10";
$z = preg_split ("/\,/", $x);
print_r($z);
?>
The output of the above code will be:
Array
(
[0] => 1
[1] => 2
[2] => 3
[3] => 4
[4] => 5
[5] => 6
[6] => 7
[7] => 8
[8] => 9
[9] => 10
)