Login or Sign Up
Logging in...
Remember me
Log in
Or
Sign Up
Forgot password or user name?
Log in with
Search in titles only
Search in PHP only
Search
Advanced Search
Forums
BYTES
Product Launch
Updates
Developer Toolkit
Today's Posts
Member List
Calendar
Home
Forum
Topic
PHP
Deprecated: Function ereg() is deprecated
Collapse
X
Collapse
Posts
Latest Activity
Photos
Page
of
1
Filter
Time
All Time
Today
Last Week
Last Month
Show
All
Discussions only
Photos only
Videos only
Links only
Polls only
Events only
Filtered by:
Clear All
new posts
Previous
template
Next
jamietrent
New Member
Join Date:
May 2010
Posts:
6
#1
Deprecated: Function ereg() is deprecated
May 7 '10, 08:52 PM
here is the line that the error is on.
ereg('([a-z]{1,2})(-([a-z0-9]+))?(;q=([0-9\.]+))?',$lang,$fo und);
AngryJoe
New Member
Join Date:
May 2010
Posts:
8
#2
May 7 '10, 09:19 PM
As of PHP 5.3 ereg is deprecated, meaning it is no longer supported. You should switch to the preg class of functions.
Click here
to go to the PHP site and check it out.
Comment
Post
Cancel
jamietrent
New Member
Join Date:
May 2010
Posts:
6
#3
May 7 '10, 09:32 PM
can you help me convert it?
Comment
Post
Cancel
dz3100
New Member
Join Date:
May 2010
Posts:
2
#4
May 7 '10, 11:57 PM
Originally posted by
jamietrent
here is the line that the error is on.
ereg('([a-z]{1,2})(-([a-z0-9]+))?(;q=([0-9\.]+))?',$lang,$fo und);
I think this is the translation:
preg_match_all( '/([a-z]{1,2})(-([a-z0-9]+))?(;q=([0-9\.]+))?/', $lang, $found);
Maybe take it for a spin? I had to do this once to drupal to get it to run on my server, and this was the solution, I think.
The functions are similar, except on the pattern, add a "/" char at the beginning and the end.
Comment
Post
Cancel
Previous
template
Next
Working...
Yes
No
OK
OK
Cancel
👍
👎
☕
Comment