See that code? It runs perfectly fine.Code:$find = array( "'<a href=\"(.*?)\" title=\"(.*?)\" tabindex=\"(.*?)\">diff</a>'i", "'<a href=\"(.*?)\" title=\"(.*?)\">hist</a>'i", ); $replace = array( "<a href=\"\\1\" title=\"\\2\" tabindex=\"\\3\"><img src=\"http://wprcph.a2h.8m6.net/diff.gif\" alt=\"diff\" /></a>", "<a href=\"\\1\" title=\"\\2\"><img src=\"http://wprcph.a2h.8m6.net/hist.gif\" alt=\"hist\" /></a>", ); $out6=preg_replace($find,$replace,$out5);
But it doesn't when I try to do this:
I wish to kill the brackets that surrond the diff and hist links, but as soon as I try the whole layout screws.Code:$find = array( "'(<a href=\"(.*?)\" title=\"(.*?)\" tabindex=\"(.*?)\">diff</a>)'i", "'(<a href=\"(.*?)\" title=\"(.*?)\">hist</a>)'i", ); $replace = array( "<a href=\"\\1\" title=\"\\2\" tabindex=\"\\3\"><img src=\"http://wprcph.a2h.8m6.net/diff.gif\" alt=\"diff\" /></a>", "<a href=\"\\1\" title=\"\\2\"><img src=\"http://wprcph.a2h.8m6.net/hist.gif\" alt=\"hist\" /></a>", ); $out6=preg_replace($find,$replace,$out5);
Any help?



Reply With Quote

Bookmarks