I was simply wondering what would be the simplest and most efficient way of extracting a certain part of a dynamic string in PHP?
Per example, in this string:
One of the following:
preg_match('~/[^/]*$~', $str, $matches); echo $matches[0];
Or:
$parts = explode('/', $str); echo array_pop($parts);
echo substr($str, strrpos($str, '/'));