Search the Community
Showing results for tags 'eregi'.
-
I've been using a script to check submissions for proper email formatting. It looks like this: eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email) Note, that I didn't write this script, it was provided by someone else. It's worked fine for years, but now I'm getting an error message saying the function has been deprecated. I think my host must have installed a new version of PHP, 5.3.2. That's cool, I just need to figure out what to replace this code with. I've done a little research and it seems there are several ways to approach this, including: 1. just replace "eregi" with "preg_match." 2. use "filter_var" and "FILTER_VALIDATE_EMAIL" instead. Any advice as to what would be the best way to update this script would be greatly appreciated. Thanks!
-
Hello! I am almost at the end of the book, and after building and testing script 13.1 test_pattern.php, I get the following screen result, including error. The result of checking against is Deprecated: Function eregi() is deprecated in D:\xampp\htdocs\php-course\chapter_13\test_pattern.php on line 24 Warning: eregi() [function.eregi]: REG_EMPTY in D:\xampp\htdocs\php-course\chapter_13\test_pattern.php on line 24 FALSE! How can I work around this to continue testing this chapter? Thanks for your help! Loving the book! Mike
- 2 replies
-
- regular
- expressions
-
(and 1 more)
Tagged with: