Re: Stripping out last 3 characters??

From: Date: Fri, 08 Dec 2000 09:10:06 +0000
Subject: Re: Stripping out last 3 characters??
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-29306@lists.php.net to get a copy of this message
The strlen doesn't even have to be included in the substr command. If you do: substr($string,0,-3); It will return all but the last three characters of $string. Matthew At 09:11 PM 12/7/2000 -0800, you wrote:
Ok, I've been busting the php manual and the archives to find this, but I can't, so sorry for asking a question which looks so trivial :( How do I strip out the last 3 characters of any given string? I tried using substr but not sure how to make it work given that I dont know where it should start stripping chars from. :( Thanks in advance!!! Sunny


« previous php.general (#29306) next »