3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $PATH = '/home/login/directory/etc/filename.jpg' ; $file = substr(strrchr($PATH, "/"), 1); $dir=str_replace($file,'',$PATH); print($dir);
Output for 4.3.0 - 7.2.0
/home/login/directory/etc/