Re: Re: Setting the filetype!

From: Date: Sun, 09 Jul 2000 22:26:25 +0000
Subject: Re: Re: Setting the filetype!
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-5646@lists.php.net to get a copy of this message
Mark wrote: > if($ext == ".gif" || $ext == " .jpg") Thanks Mark, so I really have to do a complete test each time? Phew! That can be a long line:) 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: Mark A Mucha <mmucha@cfl.rr.com> To: php-general <php-general@lists.php.net>; Sune Alexandersen <sune@drs.no> Sent: 9. juli 2000 22:24 Subject: Re: [PHP] Re: [PHP-GENERAL] Setting the filetype! > if($ext == ".gif" || $ext == " .jpg") > ----- Original Message ----- > From: "Sune Alexandersen" <sune@drs.no> > Cc: "GPHP" <php-general@lists.php.net> > Sent: Sunday, July 09, 2000 6:18 PM > Subject: [PHP] Re: [PHP-GENERAL] Setting the filetype! > > > > > $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 > > > > > > > > > > > > -- > > 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 > > > > > -- > 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 (#5646) next »