note 10170 added to Chop

From: Date: Sat, 16 Dec 2000 17:16:12 +0000
Subject: note 10170 added to Chop
Groups: php.notes 
Request: Send a blank email to php-notes+get-8792@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); } http://www.php.net/manual/function.chop.php

« previous php.notes (#8792) next »