I have the following data which is displaying as this
{123456 123456 123456}
{654321 654321 654321}
{123456 123456 123456}
My PHP Code:
$myarray = preg_split("/(\s|{\s)/", $data);
print_r($myarray);
The output of my array is like this:
[0] => {123456
[1] => 123456
[2] => 123456}
[3] => {654321
[4] => 654321
[5] => 654321}
[6] => {123456
[7] => 123456
[8] => 123456}
My question is, how to hide [0], [3] and [6] from the output? if you noticed, they start with a {
I'm not sure if I did a mistake coding the preg_split
function
Desired behavior:
if the data is like this
{1 2 3}
{4 5 6}
{7 8 9}
the desired output should be like this:
[0] => 2
[1] => 3
[2] => 5
[3] => 6
[4] => 8
[5] => 9