I'm wanting to write a little function to use in a WordPress template which will do the following:
Taking an input haystack (which would be an entire weblog entry), find the first occurrence of the needle ".mp3". First chop off anything that follows it, then move backwards until you find the beginning of the second needle, "http://", and chop off everything that precedes that.
In other words, I want to extract the full URI of an MP3 embedded in a weblog entry.
The reasons must be obvious if you consider some of my most recent postings.
This code would probably get released as a WordPress plugin once I've put it though it's paces. There's loads of functionality that could be added but this is all I need myself for now. :)
I'd really really really appreciate any help anyone can provide. Credit will of course be given where credit is due. ;)
(Oh and if you know of such a plugin already in existence, advance thanks for marking it out.)