Re: using explode

From: Date: Mon, 05 May 2008 19:16:09 +0000
Subject: Re: using explode
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-273925@lists.php.net to get a copy of this message
On 5 May 2008, at 20:04, Jason Pruim wrote:
I am wondering if I can write this cleaner? $weightExplode = explode(".", $totalWeight); $explodetest = "."; $explodetest .= $weightExplode[1]; $explodetest = $explodetest*16; I'm hoping I've missed something... Basically I just need to include the "." in $weightExplode[1] before I multiply it by 16. That's the only part that is confusing me right now...
$explodetest = ($totalWeight - intval($totalWeight)) * 16; Untested but should have the same effect as your code. -Stut -- http://stut.net/

« previous php.general (#273925) next »