If there are any whitespaces or any other characters that are predefined in a string, a function called chop() function can be used to remove them from the right side of the string which is also an alias for a function called rtrim() function in PHP. This function is supported in the fourth version and the above versions after fourth version of PHP and the return value of this function in PHP is string but is a changed string when compared to the input string passed to the function.
Start Your Free Software Development Course
Web development, programming languages, Software testing & others
The syntax to declare chop() function in PHP is as follows:
chop(string_name, char_list)
where,
The above is the detailed content of PHP chop(). For more information, please follow other related articles on the PHP Chinese website!