Re: Removing an aspect of a variable...
| From: | Robin Vickery | Date: | Tue, 06 Jun 2006 07:52:46 +0000 |
| Subject: | Re: Removing an aspect of a variable... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-237446@lists.php.net to get a copy of this message | ||
On 06/06/06, Rob W. <rob@fiberuplink.com> 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?Remove the last two characters of a string? $shorterString = substr($string, 0, -2); Whether that's really what you want to be doing with an IP address is up to you. -robin