Re: Integer
| From: | tamouse mailing lists | Date: | Sat, 02 Feb 2013 06:02:33 +0000 |
| Subject: | Re: Integer | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-320145@lists.php.net to get a copy of this message | ||
On Fri, Feb 1, 2013 at 11:27 PM, tamouse mailing lists
<tamouse.lists@gmail.com> wrote:
> On Fri, Feb 1, 2013 at 10:40 PM, Ron Piggott
> <ron.piggott@actsministries.org> 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?
Sorry for complicating things. I didn't read your request carefully enough.
YES, treat it as a string, and if you just need the last 2 digits,
just grab the substring:
php > $author = substr('2.0000000000000000000000025',-2);
php > echo $author;
25