3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $text = "INVOICE=123456:STATUS=PAID:PAY_TIME=20150525233333:STAN=123456:BCODE=ddd123 INVOICE=123457:STATUS=EXPIRED INVOICE=123458:STATUS=DENIED"; $lines = explode("\n", $text); foreach ($lines as $line) { if (preg_match_all('/(.+?)=(.+?)/', $line, $matches)) { print_r($matches); } }
based on OtlZM
Output for 4.3.0 - 7.2.0
Array ( [0] => Array ( [0] => INVOICE=1 [1] => 23456:STATUS=P [2] => AID:PAY_TIME=2 [3] => 0150525233333:STAN=1 [4] => 23456:BCODE=d ) [1] => Array ( [0] => INVOICE [1] => 23456:STATUS [2] => AID:PAY_TIME [3] => 0150525233333:STAN [4] => 23456:BCODE ) [2] => Array ( [0] => 1 [1] => P [2] => 2 [3] => 1 [4] => d ) ) Array ( [0] => Array ( [0] => INVOICE=1 [1] => 23457:STATUS=E ) [1] => Array ( [0] => INVOICE [1] => 23457:STATUS ) [2] => Array ( [0] => 1 [1] => E ) ) Array ( [0] => Array ( [0] => INVOICE=1 [1] => 23458:STATUS=D ) [1] => Array ( [0] => INVOICE [1] => 23458:STATUS ) [2] => Array ( [0] => 1 [1] => D ) )