Re: Eregi for Image

From: Date: Mon, 27 Aug 2001 06:47:14 +0000
Subject: Re: Eregi for Image
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-64582@lists.php.net to get a copy of this message
Hello Jeff, Sunday, August 26, 2001, 9:17:45 PM, you wrote: JO> I want to check if an uploaded file is an image. This isn't working. JO> Could anyone help me out? JO> if (!eregi("\\.gif$", $img1_name) || JO> !eregi("\\.jpg$", $img1_name) || JO> !eregi("\\.jpeg$", $img1_name)) { JO> error message JO> } You can find out type of uploaded file like this: if ($img1_name_type=='gif') { image is gif do this } else { image is not gif do that } I hope it helps -- Best regards, Daniel mailto:daniel@rezny.sk

« previous php.general (#64582) next »