Re: something stupid... split().

From: Date: Tue, 22 Mar 2005 02:40:39 +0000
Subject: Re: something stupid... split().
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-211252@lists.php.net to get a copy of this message
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

« previous php.general (#211252) next »