Rather use rtrim(). Usage of chop() is not very clear nor consistent for people reading the code after you.
Esta función es un alias de: rtrim().
Nota:
El comportamiento de la función chop() no es el mismo que el de la función
chop()
de Perl, que elimina el último caracter de la cadena.
Rather use rtrim(). Usage of chop() is not very clear nor consistent for people reading the code after you.
If you are searching for a function that does the same trick as chop in PERL, then you should just do the following code:
<?php
$str = substr($str, 0, -1);
?>
The question is: why isn't chop() an alias of the code above, rather than something which will trap developpers?