3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $controller = 'example.com/home/index?lang=nl'; $n = strpos($controller, "?lang="); if ($n > 0){ $lang = substr($controller, $n + 6); $controller = substr($controller,0, $n); } var_dump($lang, $controller);
Output for 4.3.0 - 7.1.0
string(2) "nl" string(22) "example.com/home/index"