ungovernable
06-23-2010, 07:59 AM
I'm trying to add tags between specific links to websites like mediafire and megaupload
currently i use this code:
$patern ='#(<a\s[^>]*href\="([^"]*(mediafire|rapidshare|megaupload|4shared|divshare|badongo|sendspace|sharebee|sendfile|filesend|kewl share|zshare|filestube)[^"]*)"[^>]*>).*?</a>#i';
$postmsg2 = preg_replace($patern, '[DL]$2', $postmsg);
but it will only replace links embbed with <a href="">...</a>
i would want to also replace links that doesn't have the <a href> tags
so basically i'm looking for a code that would transform
http://www.mediafire.com/?xxxxxx
<a href="http://www.mediafire.com/?123456">http://www.mediafire.com/?123456</a>
to:
http://www.mediafire.com/?xxxxxx
http://www.mediafire.com/?123456
thanks a lot !
currently i use this code:
$patern ='#(<a\s[^>]*href\="([^"]*(mediafire|rapidshare|megaupload|4shared|divshare|badongo|sendspace|sharebee|sendfile|filesend|kewl share|zshare|filestube)[^"]*)"[^>]*>).*?</a>#i';
$postmsg2 = preg_replace($patern, '[DL]$2', $postmsg);
but it will only replace links embbed with <a href="">...</a>
i would want to also replace links that doesn't have the <a href> tags
so basically i'm looking for a code that would transform
http://www.mediafire.com/?xxxxxx
<a href="http://www.mediafire.com/?123456">http://www.mediafire.com/?123456</a>
to:
http://www.mediafire.com/?xxxxxx
http://www.mediafire.com/?123456
thanks a lot !