Posted by jukka on 10/13/39 11:35
Oli Filth wrote:
> mcyi2mr3@lycos.co.uk said the following on 24/12/2005 15:32:
>
>> Hi all!
>>
>> Is it possible to delete the last 3 characters in a string?
>>
>
> Yes.
>
> http://php.net/substr
>
err...i meant to actually answer the question ;D
here:
$string = "abcdefg";
$length = strlen($string) - 3;
$newstring = substr($string, 0, $length);
print $newstring; //returns abcd
[Back to original message]
|