3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $str = 'component/content/article?id=9'; $query = parse_url($str, PHP_URL_QUERY); // Get the string part after the "?" parse_str($query, $params); print $params['id'];
Output for 5.1.2 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
9
Output for 4.3.0 - 5.1.1
Notice: Use of undefined constant PHP_URL_QUERY - assumed 'PHP_URL_QUERY' in /in/TRYpd on line 3 Warning: parse_url() expects exactly 1 parameter, 2 given in /in/TRYpd on line 3 Notice: Undefined index: id in /in/TRYpd on line 5