Hi guys, I've just run into a little bit of trouble with some PHP on my latest project. Basically I have a block of text ($text
) and I would like to search through that text and return all of the MP3 links. I know it has something to do with regular expressions but I just cannot get it working.
Here's my current code:
if(preg_match_all(".mp3", $text, $matches, PREG_SET_ORDER)) {
foreach($matches as $match) {
echo $match[2];
echo $text;
}
}