Try using,
<?php
$your_str = "12 , 13 , 9";
$array = explode(',', $your_str);
echo $array[0]; //12
echo $array[1]; //13 and so on...
?>
explode works quite similar to split() which has been deprecated.
Hope it helps!
1
solved PHP: Convert string to each integer variable