3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $url = "http://somedomain/somefolder/someresoure/somemodel/someaction/id?option=1&sales=mr.%20Ed&text=hello"; $query = parse_url(urldecode($url), PHP_URL_QUERY); var_dump($query); parse_str($query,$parts); var_dump($parts); ?>
based on uP82Z
Output for 5.1.2 - 7.1.0
string(32) "option=1&sales=mr. Ed&text=hello" array(3) { ["option"]=> string(1) "1" ["sales"]=> string(6) "mr. Ed" ["text"]=> string(5) "hello" }
Output for 4.3.0 - 5.1.1
Notice: Use of undefined constant PHP_URL_QUERY - assumed 'PHP_URL_QUERY' in /in/UD4QE on line 4 Warning: parse_url() expects exactly 1 parameter, 2 given in /in/UD4QE on line 4 NULL array(0) { }