3

I'm seeing the following message on my site, what should I do?

Deprecated: Function eregi() is deprecated in D:\wamp\www\cidoc.gov.mz\modules\mod_swmenupro\functions.php on line 2542

3

Here is a list of deprecated functions and the replacement functions

Function replacements POSIX PCRE 
ereg_replace() => preg_replace() 
ereg() => preg_match() 
eregi_replace() => preg_replace() 
eregi() => preg_match() 
split() => preg_split() 
spliti() => preg_split() 
sql_regcase() => No equivalent 

user preg_match() instead of eregi()

2
  • thnk u for the list, actually i had 2 problem eregi_replace too and i didnt see that thank u, it works but i use @ before eregi_replace..... – edson tomas Jan 10 '11 at 8:43
  • Preg_match is your better option. – Beaker Jan 10 '11 at 9:14
1

You're using the function "eregi()" that was deprecated in PHP 5.3.0

You can

a. downgrade your php version (not recommended) or

b. use stristr(). The manual has a comment that says this you can use to replace the code in your files:

because eregi is not recommended after php 5, you can replaced it with stristr if just for simple search.

For editors with regular expression function:

eregi\(([^,]*),([^)]*)\)
stristr(\2,\1)

I have not tried this.

1
  • thank u, that works fine but i use @ before eregi() and it works good too, when i use stristr() i have to change many lines where have eregi()...but thnk u – edson tomas Jan 10 '11 at 8:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.