3v4l.org

run code in 300+ PHP versions simultaneously
<?php $url = urlencode("http://www.example.com?r=Now&msg='365\nLES-12-5666\n1\n2\n5\n6\n'&s=&me"); preg_match("/%26msg.+%27/",$url,$matches); $ID = urldecode( $matches[0]); $myArray = explode("\\n", $ID); list(,$str) = explode("=",$myArray[0]); $str = substr($str,1,-1); $arr = explode("\n",chop($str)); var_dump($arr);
Output for 7.0.0 - 7.0.23, 7.1.0 - 7.1.25, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.19, 8.3.0 - 8.3.7
array(6) { [0]=> string(3) "365" [1]=> string(11) "LES-12-5666" [2]=> string(1) "1" [3]=> string(1) "2" [4]=> string(1) "5" [5]=> string(1) "6" }

preferences:
173.54 ms | 404 KiB | 194 Q