Update: first question resolved, was an issue with HTML/browser.
Second question: Is there a way to output the delimiters into a separate array? If I use PREG_SPLIT_DELIM_CAPTURE, it mixes the delimiters into the same array and makes it confusing as opposed to PREG_SPLIT_OFFSET_CAPTURE which designates its own key for the offset.
Code:
$str = 'world=earth;world!=mars;world>venus';
$arr = preg_split('/([;|])/', $str, -1, PREG_SPLIT_DELIM_CAPTURE);
echo "<pre>";
print_r($arr);
echo "</pre>";
DELIM CAPTURE example:
Array
(
[0] => world=earth
[1] => ;
[2] => world!=mars
[3] => ;
[4] => world>venus
)
OFFSET CAPTURE example:
Array
(
[0] => Array
(
[0] => world=earth
[1] => 0
)
[1] => Array
(
[0] => world!=mars
[1] => 12
)
[2] => Array
(
[0] => world>venus
[1] => 34
)
)