Returning a substring when values can be different
<p>I have "requests" in a database from which I need to extract the name of the image - it will always be a .jpg but the number of characters in the name could vary, so I am shying away from substr(). </p>

<p>The value looks like this "Added 545_4.jpg to Photo Album, The British Open".</p>

<p>The "Added" will always be there and the "to Photo Album, " will always be there but the name of the album differs.</p>

<p>Based on the manual I guessed that the % character means more than one character, so I tried to get that to represent the variants of photo albums. So, I ended up with this but nothing seemed to happen since it just echoes out the original string.</p>

<pre><code>$emij = str_replace('Added','', 
        str_replace(' to Photo Album%', '', $thisTask[0]['request']));
echo $emij;
</code></pre>

<p>Any help is greatly appreciated.</p>
