I've a string like this:
$str = "
test1
test2
test3
test4
test5";
I want to make this into:
array('test1','test2','test3' ect ect)
How would I do that?
I've a string like this:
$str = "
test1
test2
test3
test4
test5";
I want to make this into:
array('test1','test2','test3' ect ect)
How would I do that?
More specifically, use the explode function using the line ending as the delimiter, then wrap that in the array_filter function to remove any stray entries from the odd line entries.
$arr = array_filter(explode("
", $str));