So basically I have a column in the database which has stored multiple values like this
0 , 33, 0, 0, 138, 1231
What i would like to do is build an array from the output obtained from the database:
$values = $fetch['values'];
So basically I have a column in the database which has stored multiple values like this
0 , 33, 0, 0, 138, 1231
What i would like to do is build an array from the output obtained from the database:
$values = $fetch['values'];
<?php
$values = '0,33,0,0,138,1231';
$array = explode(',', $values);
var_dump($array);
?>
The output:
array(6) { [0]=> string(2) ""0" [1]=> string(2) "33" [2]=> string(1) "0" [3]=> string(1) "0" [4]=> string(3) "138" [5]=> string(4) "1231" }
More info here