3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?phpfunction getCatalog($path, $number) { $catalogs = explode('/', $path); return $catalogs[count($catalogs) - $number - 1];}echo getCatalog('/a/b/c/d/e/f/g/h/i', 4);
Output for 5.3.0 - 5.4.32
<?phpfunction getCatalog($path, $number) { $catalogs = explode('/', $path); return $catalogs[count($catalogs) - $number - 1];}echo getCatalog('/a/b/c/d/e/f/g/h/i', 4);