Google
 

Sunday, December 23, 2007

Alias Of rtrim Function

chop() is different than the Perl chop() function, which removes the last character in the string. Another possible one would be to use this:

<?php
function chup(){
$ar=Array();
foreach(func_get_args() as $b) {
push($ar,$b[strlen($b)-1]);
&$b[strlen($b)-1]='';
}
return $ar;
}
?>

If you wanted to perl-chop a va list of strings and return the removed chars. Obviously you can easily mod it for va list arrays of strings and the like.