3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function extension($str){ $str=implode("",explode("\\",$str)); $str=explode(".",$str); $str=strtolower(end($str)); return $str; } // EXAMPLE: $file='name-Of_soMe.File.txt'; echo extension($file); // txt ?>
Output for 4.3.0 - 7.2.0
txt