strings
Posted: Fri Jun 21, 2002 9:25 pm
Say I have a string $string="hello==" how do I remove the last two character from the string?
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
$string = substr($string,0,(strlen($string)-2));Code: Select all
$string = ereg_replace("=","",$string);Code: Select all
$string = str_replace("=", "", $string);Code: Select all
$string = substr($string,0,(strlen($string)-2));Code: Select all
$string = substr($string, 0, -2);