find two option but dont repeat
Posted: Mon Nov 27, 2006 10:28 am
i need test if the address works in a site, may be that these urls are writen simple like (without *) *http://domine.some/folder/file.extention
or thus <a href="url">url</a>
the problem is that in some cases the links are thus <a href="url">word!=url</a> if i find some <a href="url"> i replace it by the same but then of href=url> an image red or green depending if that work (the url), then if i search that are simplely wroten as i shown first may be that i find again the same url but between a tags and put again the image, and in this case would has two time the image, it would appear thus
http://url.some
and i dont want thus, my regex is it
how i would do to fix that?
or thus <a href="url">url</a>
the problem is that in some cases the links are thus <a href="url">word!=url</a> if i find some <a href="url"> i replace it by the same but then of href=url> an image red or green depending if that work (the url), then if i search that are simplely wroten as i shown first may be that i find again the same url but between a tags and put again the image, and in this case would has two time the image, it would appear thus

http://url.someand i dont want thus, my regex is it
Code: Select all
$tutu=preg_replace_callback("/((<\s*a\s+[^>]*href\s*=\s*(((\"|'|`)".$value[0]."\\5)|(".$value[0]."))[^>]*>)|(".$value[0]."))/i","bot",$tutu);