skip to main
|
skip to sidebar
Digdans Deductions
Wednesday, November 18, 2009
Removing last character of a string in PHP
Simple :
$string = substr_replace($string ,"",-1);
That is the quickest I have found. Alternately I have done :
$string = substr($string,0,strlen($string)-1);
or
$string = substr($string,0,-1);
No comments:
Post a Comment
Older Post
Home
Subscribe to:
Post Comments (Atom)
Search This Blog
Blog Archive
▼
2009
(5)
▼
November
(2)
Removing last character of a string in PHP
Dvorak Programmer
►
October
(3)
Followers
No comments:
Post a Comment