3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $str = 'component/content/article?id=54&mtr=34'; $query = parse_url($str, PHP_URL_QUERY); // Get the string part after the "?" parse_str($query, $params); print $params['id'];
based on TRYpd
Output for 5.1.2 - 5.6.28, hhvm-3.12.0, 7.0.0 - 7.1.0
54
Output for hhvm-3.10.0

Process exited with code 153.
Output for 4.3.0 - 5.1.1
Notice: Use of undefined constant PHP_URL_QUERY - assumed 'PHP_URL_QUERY' in /in/cu2Ht on line 3 Warning: parse_url() expects exactly 1 parameter, 2 given in /in/cu2Ht on line 3 Notice: Undefined index: id in /in/cu2Ht on line 5