Re: Integer
| From: | Shawn McKenzie | Date: | Sat, 02 Feb 2013 18:43:14 +0000 |
| Subject: | Re: Integer | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-320146@lists.php.net to get a copy of this message | ||
On 02/01/2013 10:40 PM, Ron Piggott wrote:
> In the following the “2.” means a moderator response and “25” is the account # of the
> moderator.
>
> <?php
>
> $author = 2.0000000000000000000000025
>
> ?>
>
> How can I get the 25 by itself?
> - I want to drop the “2.” and remove all the zero’s
>
> Would it be best to turn this into a STRING?
>
> Any suggestions?
>
>
> Ron Piggott
>
>
>
> www.TheVerseOfTheDay.info
>
Yeah needs to be a string:
$author = "2.0000000000000000000000025";
list($a, $b) = explode('.', $author);
echo (int)$a . ' ' . (int)$b;