|
Posted by Mad Hatter on 11/16/07 11:49
Hi
>
> A quick and dirty way to get the extension:
>
> $extension = strrev(substr(strrev($_FILES['userfile']['name']), 0,
> strpos(strrev($_FILES['userfile']['name']), '.')));
>
> (It reverses a string so that it gets the first from the end then
> reverses the result)
That's a much better method than the one I was going to use :-
$upname=($_FILES["userfile"]["name"]);
$extension = substr($upname, strrpos($upname, '.') + 1);
Thanks for that :)
Navigation:
[Reply to this message]
|