Deprecated: Function Ereg() Is Deprecated In Php Line 80
- Forums
- PHP
- Deprecated: Function Ereg() Is Deprecated In Php Line 80
this is what i did when i got this error Deprecated: Function ereg() is deprecated in php line 80 [1306], Last Updated: Sat May 18, 2024
wallpaperama
Sun Apr 15, 2012
0 Comments
311 Visits
today i was updating some code i have on a script i use all the time, then all of the sudden i see this error message:
Deprecated: Function ereg() is deprecated in /var/html/www/index.php on line 80
ok, so what does this error mean? well, i went look at line 80 of index.php and i was using the function: ereg()
i went to the official PHP website: http://php.net/manual/en/function.ereg.php
i guess this function was discontinued, i have PHP Version 5.3.8 running on my development server
so my next question was.. what does DEPRECATED mean?
i looked it up and it means:
1.to express earnest disapproval of.
2.to urge reasons against; protest against (a scheme, purpose, etc.).
3.to depreciate; belittle.
so what does it really mean in plain English? - it means STOP USING IT
so what can use you instead? you can replace the ereg() function in your script with any of the following:
eregi() - Case insensitive regular expression match
ereg_replace() - Replace regular expression
eregi_replace() - Replace regular expression case insensitive
preg_match() - Perform a regular expression match
strpos() - Find the position of the first occurrence of a substring in a string
strstr() - Find the first occurrence of a string
quotemeta() - Quote meta characters
* I recommend you use strpos() its faster
hope that helps