3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $uri = "/user/123/"; $tmp = explode("/", $uri); print_r($tmp); $tmp = explode("/", trim($uri, "/")); print_r($tmp); $tmp = preg_split("~/~", $uri, -1, PREG_SPLIT_NO_EMPTY); print_r($tmp);
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Array ( [0] => [1] => user [2] => 123 [3] => ) Array ( [0] => user [1] => 123 ) Array ( [0] => user [1] => 123 )