3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "Hello world; This is a nice day; after"; $str = explode(";",$string); echo substr($string, 0, strrpos($string, ";"));

preferences:
39.29 ms | 402 KiB | 5 Q