Re: Using split to establish extension of file
| From: | Curt Zirzow | Date: | Thu, 08 Jul 2004 01:52:03 +0000 |
| Subject: | Re: Using split to establish extension of file | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-189939@lists.php.net to get a copy of this message | ||
* Thus wrote Russell Curtis:
> I'm trying to use the split function to identify the extension of an
> uploaded file:
>
> $file_name = $_FILES['userfile']['name'];
> $pieces = explode(".", $file_name);
> $file_extension = $pieces[1]; // piece2
You could always use the built in php function pathinfo()
http://php.net/pathinfo
Curt
--
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about. No, sir. Our model is the trapezoid!