get file name from path with PHP and regular expressions
<p>I have an array of image files with relative paths, like this: <code>gallery/painting/some_image_name.jpg</code>. I am passing this array into a <code>foreach</code> loop which prints the path into the source of an <code>&lt;img&gt;</code>.</p>

<p>What is a safe reliable way to pull the name from a line such as that?</p>

<p><strong><code>gallery/painting/some_image_name.jpg</code></strong> > to > <strong>some image name</strong></p>
