note 10170 deleted from function.chop by irc-html

From: Date: Wed, 16 Jan 2002 16:20:38 +0000
Subject: note 10170 deleted from function.chop by irc-html
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-24901@lists.php.net to get a copy of this message
The perl_chop function that tracy@finifter.com describes does not only remove the last character in a string, it removes _all_ characters that are same as the last one. Rather you should use something like: function perl_chop ($string) { return substr($string, 0, strlen($string) - 1); }

« previous php.notes (#24901) next »