Jump to content

[SOLVED] Check a field for a specific string


demon_athens

Recommended Posts

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.

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.