note 39157 added to function.substr
| From: | deanw at coastalnow dot net | Date: | Mon, 19 Jan 2004 07:16:08 +0000 |
| Subject: | note 39157 added to function.substr | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-63814@lists.php.net to get a copy of this message | ||
To pop the last character off of a string:
function popChar($str){
return(substr($str,0,-3));
}
I know, it's very simple. I spent around 15 minutes looking for this small solution, when it
should have been obvious. This is just for any other people who have blonde moments.
----
Manual Page -- http://www.php.net/manual/en/function.substr.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+39157
Delete -- http://master.php.net/manage/user-notes.php?action=delete+39157&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+39157&report=yes
Search -- http://master.php.net/manage/user-notes.php