I've got a string like...
$string = "<img src=\"http://www.mbl.is/myndir/skidi/0.gif\" width=\"50\" height=\"2\" border=\"0\" alt=\"\"><img src=\"http://www.mbl.is/myndir/skidi/0.gif\" width=\"34\" height=\"0\" border=\"0\" alt=\"\"><img src=\"http://www.mbl.is/myndir/skidi/0.gif\" width=\"61\" height=\"5\" border=\"0\" alt=\"\">";
How do I erase everything that is similar to this: <img src="http://www.mbl.is/myndir/skidi/0.gif" width="" height="" border="" alt="">
Use a regex that looks for the starting characters '<img src="http://www.mbl.is/myndir/skidi/0.gif"' and ends with '>' and have it replaced with ''.
Yes I know that but I need to see HOW to do it.
$pattern = "<img src=\"http://www.mbl.is/myndir/skidi/0.gif".[>]>"; $replace = ""; $str = preg_replace($pattern, $replace, $orig);
Now I'm not a regex expert, but that should at least give you a starting place for making this work.