demon_athens Posted May 20, 2007 Share Posted May 20, 2007 I want to check a form field and give an error if found " \\n" or "\\are" strings in the field so I tried eregi and preg_match but I couldn't do it. any ideas? my wrong code is if(eregi("\\n",$value)) {$spam = 1;} if(preg_match("/\b\\n/i", $value)) {$spam = 1;} seems "\\" characters create problem. my final thoughts is to use explode, but it doesn't feel right. Quote Link to comment Share on other sites More sharing options...
trq Posted May 20, 2007 Share Posted May 20, 2007 If your looking for the literal string \\n you would use... if(eregi("\\\\n",$value)) {$spam = 1;} Quote Link to comment Share on other sites More sharing options...
demon_athens Posted May 20, 2007 Author Share Posted May 20, 2007 thank you very much! Quote Link to comment 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.