RE: [PHP] Removing an aspect of a variable...
| From: | Peter Lauri | Date: | Tue, 06 Jun 2006 02:51:12 +0000 |
| Subject: | RE: [PHP] Removing an aspect of a variable... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-237445@lists.php.net to get a copy of this message | ||
But that will just give you .0. If you have 192.168.100.232 it will return
32. You have to check where the . is and then take the substring from that.
Use strpos or similar for that (I do not know if that can check backwards)
-----Original Message-----
From: Rob W. [mailto:rob@fiberuplink.com]
Sent: Tuesday, June 06, 2006 2:47 PM
To: richgray@gmail.com
Cc: php-general@lists.php.net
Subject: Re: [PHP] Removing an aspect of a variable...
Tnx.
----- Original Message -----
From: "rich gray" <richgray@gmail.com>
To: "Rob W." <rob@fiberuplink.com>
Sent: Tuesday, June 06, 2006 2:44 AM
Subject: Re: [PHP] Removing an aspect of a variable...
> substr($variable,0,-2);
>
> Rob W. wrote:
>> Say I have a variable setting an ip address of 192.168.100.0
>>
>> I want to be able to remove the last to chr's of that variable ie: .0
>>
>> What would be my best solution to do that?
>>
>
>
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php