I'm using xpath to get specific image link from my birthday pictures. I seem to fetch all the urls that contains "media:content" but I'm trying to get only one. Is there a way to do some sort of wild strings to find an element containing a keyword/string? I wouldn't be able to predict the exact filename, just the directory (event,picture,birthday,wedding). If this isn't possible, how would I go about it and fetch only one media:content from row 1,2,3 or 4 for each item if I know which row I would want to retrieve?
There's two formats I have trouble with. I'm not sure if it makes a difference that 'media:group' is there.
$birthday = $item->xpath("//media:content");
$birthday = $birthday[$i]['url'];
How would I only pull "http://www.site.com/event/birthday/2.jpg" from strings containing event and birthday?
and
pull "http://www.site.com/picture/birthday/1b.jpg" from strings containing picture and birthday?