Hello,
We have switched to a new server with latest Php version and all of a sudden are getting Error message:
Function eregi() is deprecated in…
We are using eregi() in this way to see that Fotos uploaded have filetype JPG, GIF PNG:
if (eregi(‘^image/p?jpeg(;.*)?$’, $_FILES[‘uploadedfile’][‘type’])) {
$filetype = ‘jpg’;
}
The documentation says replace eregi with preg_match, which we did as here:
if (preg_match(‘^image/p?jpeg(;.*)?$’, $_FILES[‘uploadedfile’][‘type’])) {
$filetype = ‘jpg’;
}
but when we do this produces Error message:
Warning: preg_match(): No ending delimiter ‘^’ found in
So what is the right method for replacing the eregi() is deprecated?
ThanX.