mysterbx Posted January 27, 2008 Share Posted January 27, 2008 Hello, is it possible to not show the text if it already exists in the petern? Example: $text= "Here is your download link: http://example.com/download1.exe http://example.com/download2.exe Or you can use this one (the same) http://example.com/download1.exe http://example.com/download2.exe"; Output(response from a simple script) http://example.com/download1.exe http://example.com/download2.exe http://example.com/download1.exe http://example.com/download2.exe Response from the script I am looking for: http://example.com/download1.exe http://example.com/download2.exe No same links shouldnt appear in the output or "echo"... it should be possible? Quote Link to comment https://forums.phpfreaks.com/topic/88081-if-text-exists-dont-show-it/ Share on other sites More sharing options...
mysterbx Posted January 27, 2008 Author Share Posted January 27, 2008 oh, btw im usig this preg_match_all("#(^|[\n ])([\w]+?://[^ \"\n\r\t<]*)#ise", $htmlbody, $links); foreach($links[2] as $link) echo "$link to search for http links in the text... Quote Link to comment https://forums.phpfreaks.com/topic/88081-if-text-exists-dont-show-it/#findComment-450627 Share on other sites More sharing options...
PHP Monkeh Posted January 27, 2008 Share Posted January 27, 2008 If you put $links[2] = array_unique($links[2]); before your loop that should remove any duplicate values. Quote Link to comment https://forums.phpfreaks.com/topic/88081-if-text-exists-dont-show-it/#findComment-450682 Share on other sites More sharing options...
mysterbx Posted January 28, 2008 Author Share Posted January 28, 2008 yet again... it works! 10x again... maybe you could answer to this topic: http://www.phpfreaks.com/forums/index.php/topic,179082.0.html ? The last components... Quote Link to comment https://forums.phpfreaks.com/topic/88081-if-text-exists-dont-show-it/#findComment-451011 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.