I am planning to use preg_replace to remove some unwanted stuff from dynamic string
<ul><li><a href="http://www.url.com/wiki/How_to_fix_erection_problems_after_prostate_surgery&diff=335&oldid=prev">How to fix erection problems after prostate surgery</a></li>
<li><a href="http://www.url.com/wiki/Wikipenis:Community_Portal&diff=334&oldid=prev">Wikipenis:Community Portal</a></li>
This string is generated from an RSS reader. (The url has obviously been replaced to make sure no one thinks this is a spam post)
What I need to do is figure out a way to go through the string and remove the "&diff=335&oldid=prev" and the "&diff=334&oldid=prev"
I can not just use str_replace() because those two constantly change. However I assume it is possible with a regular expressions I just don't know regular expressions well enough to write one...but basically it needs to say something like:
preg_replace("&diff=" and all characters in the middle to "=prev", "", $mystring);