since PHP6 won't support ereg at all, i had a bit of free time to go through the code on all my websites to convert ereg to preg (which, for the most part, isn't especially difficult)...since i tend to reuse functions pretty regularly, it's not a big chorei do, however, have this line in my email-checking function that is giving me trouble, but that's because i don't know my regex as well as i should:
ereg("^(([A-Za-z0-9!#$%&'*+/=?^_`{|}~-][A-Za-z0-9!#$%&'*+/=?^_`{|}~\.-]{0,63})|(\"[^(\\|\")]{0,62}\"))$",$local_array[$i])
preg_match("/^(([A-Za-z0-9!#$%&'*+/=?^_`{|}~-][A-Za-z0-9!#$%&'*+/=?^_`{|}~\.-]{0,63})|(\"[^(\\|\")]{0,62}\"))$/i",$local_array[$i])
11/6/2009 2:32:55 PM
i thought you could still use eregi?this is currently working for me (file uploads):
if (eregi('(.jpg)|(.jpeg)^', $sFileName)) { $sMimeType = 'image/jpeg';
11/6/2009 3:26:42 PM
^ on PHP6?
11/6/2009 3:29:40 PM
oh sorry 4.3.10 >.<
11/6/2009 4:46:01 PM
sweet, i didn't know about the filter_var thing
preg_match("/^(([A-Za-z0-9!#$%&'*+\/=?^_`{|}~-][A-Za-z0-9!#$%&'*+\/=?^_`{|}~\.-]{0,63})|(\"[^(\\|\")]{0,62}\"))$/i",$local_array[$i])
11/6/2009 7:16:17 PM
11/6/2009 7:30:34 PM