Re: Re: splitting a string

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jan 5, 2010 at 16:09, Shawn McKenzie <nospam@xxxxxxxxxxxxx> wrote:
> Of course this doesn't work for something like 'My.Word.Document.docx'
> or 'archive_v2.0.1.tar.gz', but I don't know what will with extensions
> being variable length and possibly composed of multiple periods.

I suppose a solution to that could be having a list of known file
extensions and use that while falling back to one of the methods given
in this thread if there is no match in the list. Of course you would
then have to check .tar.gz before .gz if you're just iterating through
a list. You might also just choose the longest match (in terms of
number of periods).

-- 
Daniel Egeberg

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux