I get from my database a string that looks like:
$result = "[02,04,05,09,21]";
And that works as a string all together, is that possible that I make it an array that would like: array[0] = 02 , array[1] = 04, and so go on?
Yes this is possible:
$result = "[02,04,05,09,21]";
$result = substr($result, 1, -1);
$arr = explode(",", $result);
Trim the bracket notations from the string and simply explode it with comma
$result = "[02,04,05,09,21]";
$result = rtrim(ltrim($result, '['), ']');
$array = explode(',', $result);
echo '<pre>';
print_r($array);