Re: separating a file extention
| From: | Justin French | Date: | Mon, 19 Jul 2004 03:35:15 +0000 |
| Subject: | Re: separating a file extention | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-190969@lists.php.net to get a copy of this message | ||
On 19/07/2004, at 9:22 AM, C.F. Scheidecker Antunes wrote:
Is there any easy and efficient way to separate files extention that vary in size? Some have 3 chars after the dot, some 2, some 1, some 4, some none. Examples: test.zip test.gz test.z test.jpeg test.jpg test (no extention)<? $filename = "something.foo.bah.jpeg"; $bits = explode('.',$filename); $ext = $bits[count($bits)-1]; echo $ext; ?> --- Justin French http://indent.com.au