Jump to content

eregi Help


DanyalSakrani

Recommended Posts

Ummm the ereg format would look something like this:

 

$pattern = '/!|@|#|$|%|^|&|*|\(|\)/'

 

There has to be a better, more effecient, way to do that though....

 

If you're trying to block everything besides a-z A-Z 0-9 and spaces I would suggest something like:

 

$pattern = "/[^a-z0-9 ]/i";
if(preg_match($pattern, $input)) {
//got invalid stuff
}

Link to comment
https://forums.phpfreaks.com/topic/57475-eregi-help/#findComment-284376
Share on other sites

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.