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

Posted by Kim Madsen on 03/17/05 13:26

-----Original Message-----
From: Chris Knipe [mailto:savage@savage.za.org]
Sent: Thursday, March 17, 2005 12:16 PM
To: php-general@lists.php.net
Subject: [PHP] something stupid... split().

> 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 ;)

"." means any char in regular expressions.

list($Duration, $none) = split('\.', ConvertTime($AcctSessionTime/90),
2);

will do the trick for ya.

--
Med venlig hilsen / best regards
ComX Networks A/S
Kim Madsen
Systemudvikler/Systemdeveloper
Naverland 31

DK-2600 Glostrup
www.comx.dk
Telefon: +45 70 25 74 74
Telefax: +45 70 25 73 74
E-mail: km@comx.dk

 

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

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