- substr: documentation ( source)
- var_dump: documentation ( source)
<?php
$reverse = TRUE;
$separator = '/';
$str = 'test/ezifh';
$f = $reverse ? 'strrpos' : 'strpos';
if (($pos = $f($str, $separator)) !== FALSE) {
$str = substr($str, $pos + 1);
}
var_dump($str);