View Full Version : php question
03-30-2007, 08:22 AM
if there is a line in comment
"great shot, please visit <a href="www.xxx.com">mycc.com</a> for more infomation."
is it possible to delete only "<a href="www.xxx.com">mycc.com</a>"? and keep others.
03-30-2007, 09:33 AM
Yeah that is possible, but if the url is either in a blacklist or DSBL list, the comment is rejected because it is a spam comment. Spammers tend to find every shot a great shot. ;)
03-30-2007, 09:45 AM
schonhose, I meant how to write the codes but not pixelpost's function.
Read i.e. about preg_replace or ereg_replace functions. They are based on regular expressions thanks to which you need to know only pattern for such part of comments.
03-30-2007, 05:16 PM
GeoS, I'm confused on using two functions. can it clear whole line "<a href="www.xxx.com">mycc.com</a>", I mean including "www.xxx.com" and "mycc.com", but they are variables. can it?
if it can, would you please write an simple example for me?
It should be useful for many of our users:
03-31-2007, 01:11 PM
WOW. it's great! GeoS. it took me some time to understand, but it works!
03-31-2007, 02:24 PM
and to learn the basics about regular expressions have a look here:
(don't be bothered because it points to an email client, the basics are the same)
04-01-2007, 01:22 AM
vBulletin® v3.7.3, Copyright ©2000-2013, Jelsoft Enterprises Ltd.