I have a line that has different meanings in each line:
$matches="value1 value2 value3 value4 value5 ";
I want to split the entire string into an array consisting of divided values. I know how to explode a string separated by a space, like explode(' ', $matches)
. But how can I use the diversity function for this type of string?
I tried this:
$matches=explode('\n',$matches); print_r($matches);
But the result is this:
Array ( [0] => hello hello hello hello hello hello hello )
Sujit agarwal
source share