note 41800 deleted from function.strstr by thiago

From: Date: Tue, 28 Oct 2008 13:46:01 +0000
Subject: note 41800 deleted from function.strstr by thiago
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-145871@lists.php.net to get a copy of this message
Note Submitter: Ami Hughes (ami at mistress dot name) ---- Because I was working with two different sets of variables and wanted to combine the result into a decimal format, I needed to strip the zero before the decimal. As an added bonus, this will strip anything before a decimal (or period), which might be useful for other things. So, if you are trying to combine apples and oranges like I was, or whatever, try this. =) <?php $number = '0.529'; strstr($number,'.'); echo $number; // returns .529 ?>

« previous php.notes (#145871) next »