note 41800 added to function.strstr
| From: | (ami@mistress.name) | Date: | Thu, 22 Apr 2004 13:02:39 +0000 |
| Subject: | note 41800 added to function.strstr | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-68529@lists.php.net to get a copy of this message | ||
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
?>
----
Manual Page -- http://www.php.net/manual/en/function.strstr.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+41800
Delete -- http://master.php.net/manage/user-notes.php?action=delete+41800&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+41800&report=yes
Search -- http://master.php.net/manage/user-notes.php