IS there any function that would take off the last character of a string? If I have $string="Hello World"; How do I make it $sring="Hello Worl";
I don't replace it with a space, because I want the string to actually be one character less and also the string coming in is a variable so the last character that I need to remove is going to be different (well one of 4 characters) if that helps.
Thanks
The function you're looking for is substr().
Actually, to clarify, you could do something like this.
$string = "Hello World"; $reartrim = $string - 1; $string = substr($string,0,$reartrim);
Probably need to use the strlen function in there somewhere....
$string = "Hello World";
$string = substr($string,0,strlen($string)-1);
ok, exactly what I needed, wandering how I missed that one in manual, guessed I was reading too much too long, o well
thanks much