Jump to content

Deprecated eregi statement


lkeeney

Recommended Posts

I know next to nothing about this part of PHP. However I was able to generate a rather large application form using eregi statements that worked fine until they deprecated the eregi statement.

 

I understand I should use the preg_match statement but I can't get it to work on my form.

 

Here is the first statement in my form:

$string_exp = "^[a-z .'-]+$";
 if(!eregi($string_exp,$first_name)) {
  $error_message .= 'The First Name you entered does not appear to be valid.';}

 

Can someone tell me how to convert this to a preg_match statement? Or if there is another better method please let me know.

 

Lawrence

Link to comment
https://forums.phpfreaks.com/topic/274637-deprecated-eregi-statement/
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.