Re: Setting the filetype!

From: Date: Fri, 23 Jun 2000 16:38:35 +0000
Subject: Re: Setting the filetype!
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-2816@lists.php.net to get a copy of this message
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

« previous php.general (#2816) next »