Re: checking image extensions

From: Date: Sun, 18 Feb 2001 11:34:48 +0000
Subject: Re: checking image extensions
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-40416@lists.php.net to get a copy of this message
> > if ((substr($imgName, -4) != ".jpg") || (substr($imgName, -4) != ".gif")) this case, in plain english is : if ext is not jpg, OR if ext is not gif, error the ext will never be both jpg and gif at the same time, so you're looking for the condition: if ((substr($imgName, -4) != ".jpg") && (substr($imgName, -4) != ".gif")) { //error } else { //do image processing thing. } also note, some progs. save jpegs as .jpeg

« previous php.general (#40416) next »