You could explode the string into an array, move the array-pointer to the end of the array and pick up the value at that element. Like this :
<?php
$path = "work\photographers\meatyard\";
$pathbits = explode('\', $path); // explode into array
end($pathbits); // go to the end
prev($pathbits); // rewind by one element
list($index, $value) = each($pathbits); // pick up the element
echo "Last dir : $value<br>\n"; // display the value
?>
And ofcourse you could use this example for lots of other things.