You are here: Re: [PHP] something stupid... split(). « PHP « IT news, forums, messages
Re: [PHP] something stupid... split().

Posted by Richard Lynch on 10/04/39 11:11

On Thu, March 17, 2005 3:16 am, Chris Knipe said:
> Lo all,
>
> echo ConvertTime($AcctSessionTime/90); # Returns: 03:17:46.7666666667
>
> I am trying to drop the .whatever.. Thus,
>
> list($Duration, $none) = split('.', ConvertTime($AcctSessionTime/90), 2);
>
>
> However, $Duration is empty, and $none has the whole string from
> ConvertTime.... As I said, something silly ;)

split does regular expressions.

Where '.' means "any character"

So you *could* do '\\.' instead of '.'

But http://php.net/explode is the better answer here.

--
Like Music?
http://l-i-e.com/artists.htm

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация