Re: Setting the filetype!

From: Date: Sun, 09 Jul 2000 22:18:41 +0000
Subject: Re: Setting the filetype!
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-5643@lists.php.net to get a copy of this message
> $ext = strrchr($_file,'.'); > > -Rasmus Hi Rasmus and rest of the list! I thought my problem was solved, but it is not. When I try this: if($ext == ".gif" or " .jpg") or if($ext == ".gif" | " .jpg") or even if($ext == ".gif" || " .jpg") It only OK¨s on GIF, not on JPG. Also, is there a way to ignore case? The extension might be in upper case. Thank you all for your time. regards, Sune Alexandersen -------------------- Company site: http://www.drs.no Private site: http://www.suneworld.com Wap site: http://tagtag.com/suneworld Download WebExplorer today and manage your PHP enabled website in your webbrowser! Its free! http://www.suneworld.com/programs (over 1.800 downloads since release) ----- Original Message ----- From: Rasmus Lerdorf <rasmus@php.net> To: Kevin Beckford <kbeckford@bigorbit.com> Cc: Sune Alexandersen <sune@drs.no>; GPHP <php-general@lists.php.net> Sent: 23. juni 2000 17:38 Subject: Re: [PHP-GENERAL] Setting the filetype! > On Fri, 23 Jun 2000, Kevin Beckford wrote: > > > This code gives the extension as $matches[2]. You can then check to see what > > the extension is and code for whatever > > > > function check_ext($_file) > > { > > if(preg_match("/(\.[^.]*)*(\..+$)/",$_file,$matches)); > > Wow. Isn't that overkill just to get the extension? How about: > > $ext = strrchr($_file,'.'); > > -Rasmus > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > >

« previous php.general (#5643) next »