FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Eregi possible problem
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Eregi possible problem [message #169353] Wed, 08 September 2010 08:02 Go to previous message
GarryJones is currently offline  GarryJones
Messages: 21
Registered: September 2010
Karma:
Junior Member
To fix another problem I turned errors reporting on (I normally have
it off so users dont see errors that are not a problem).

I then received a surprising message about another line of code that
has worked for years. It says that eregi is depreciated, I am unsure
what that means as my code was still working so its strange that this
error came up as it is not an actual error. Maybe depreciated means we
dont want you to use this any more but if you do its okay?

Anyway I thought it best to change it just in case. I googled and
found a link to a function called preg that looks like it does the
job.

My question is are there any differences in the performance of eregi
and preg?

if (!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.
[a-z]{2,3})$", $allepst)){
$emlstatus = 0; // invalid
} else {
$emlstatus = 1; // valid
}

if(!preg_match("/^[_\.0-9a-zA-Z-]+@([0-9a-zA-Z][0-9a-zA-Z-]+\.)+[a-zA-
Z]{2,6}$/i", $allepst)) {
$emlstatus = 0; // invalid
} else {
$emlstatus = 1; // valid
}

On a sidenote to this I wonder who changes the internet and why. If a
line of code works perfectly and serves a purpose and works for years
and years and years I don't get why anyone would want to change it.
Maybe it was not working on Google crome, firefox or macintosh, but I
always feel people who dont use a pc and msie can blame themselves
when websites dont work properly as most websites are written for msie
on a pc. I do now try to get things working in firefox. I still can't
get any of my flash code on my websites to work on my iphone but thats
not a question for this newsgroup.... Any feedback on eregi
APPRECIATED - do the two snippets of above code produce absolute
identical results for all input?

..
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Another heredoc question
Next Topic: php filling in listbox value based on db record ??
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Nov 22 21:47:44 GMT 2024

Total time taken to generate the page: 0.04271 seconds