Page 1 of 1

Image Upload Script

Posted: Mon Sep 06, 2010 11:00 am
by spec36
I am playing with an image upload script and everything seems to be working, but I get this error/warning message,

[text]Deprecated: Function eregi() is deprecated in....[/text]

Looks like eregi will no longer be available in PHP6. Does anyone know what I can use instead of eregi in the below code?

Code: Select all

 if(!eregi('image/', $_FILES['attachement']['type'])) {

      echo 'The uploaded file is not an image please upload a valid file!';

    } 
ANy help would be greatly appreciated.

Re: Image Upload Script

Posted: Mon Sep 06, 2010 1:05 pm
by oscardog
I am not sure if it's the exact same syntax but I believe [urhttp://php.net/manual/en/function.preg-match.php]preg_match[/url] will do a similar job to eregi.