How can I convert loop result of string to an array? For instance, I have this strings:
$nmbrs = '111, 222, 333, 444';
This $nmbrs variable should come from an for loop as that:
$numberPrefixes = '__';
for ($i = 0; $i < 10; ++$i) {
$numbers = $numberPrefixes . randomNumberSequencePhone();
}
$array1 = explode(',', $numbers);
var_dump($array1);
And I want to get:
array(4) {
[0]=>
string(1) "111"
[1]=>
string(1) "222"
[2]=>
string(1) "333"
[3]=>
string(1) "444"
}