I have an array of image files with relative paths, like this: gallery/painting/some_image_name.jpg. I am passing this array into a foreach loop which prints the path into the source of an <img>.
What is a safe reliable way to pull the name from a line such as that?
gallery/painting/some_image_name.jpg > to > some image name