chop

(PHP 4, PHP 5)

chopAlias of rtrim()

Description

This function is an alias of: rtrim().

Notes

Note:

chop() is different than the Perl chop() function, which removes the last character in the string.

Коментарии

Автор:
Rather use rtrim(). Usage of chop() is not very clear nor consistent for people reading the code after you.
2015-04-11 13:30:13
http://php5.kiev.ua/manual/ru/function.chop.html
Автор:
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($str0, -1);
?>

The question is: why isn't chop() an alias of the code above, rather than something which will trap developpers?
2015-08-11 12:46:33
http://php5.kiev.ua/manual/ru/function.chop.html

    Поддержать сайт на родительском проекте КГБ