Monday, January 11, 2010

php ereg is deprecated

Since php 5.3, a lot of functions has been deprecated.
One of the issue is oscommerce. These are the suggested replacement for the code:

ereg => preg_match
eregi => preg_match('/[existing]/i'...)
split => preg_split
ereg_replace => preg_replace

example for eregi:
eregi('^[a-z0-9]$', $char)
to
preg_match('/^[a-z0-9]$/i', $char);


hope it helps :)

No comments: