First of all, explain separately,
Trim filters both ends of the string,
RTrim filter String tail, =chop ()
LTrim filter string header.
Filter the key in the string can only use Str_replace.
Let me give you an example of how
PHP code
Copy the Code code as follows:
$str = ' 123,333,234, ';
Echo RTrim ($str, ', ');
RTrim Instance Code 2
Copy the Code code as follows:
$text = "\t\tthese is a few words:) ... ";
$trimmed = RTrim ($text);
$trimmed = "\t\tthese is a few words:) ..."
$trimmed = RTrim ($text, "\ T.");
$trimmed = "\t\tthese is a few words:)"
$clean = RTrim ($binary, "\x00". \x1f ");
Trim the ASCII control characters at the end of $binary
(from 0 to inclusive)
?>
http://www.bkjia.com/PHPjc/326706.html www.bkjia.com true http://www.bkjia.com/PHPjc/326706.html techarticle first, respectively, trim filter string ends, RTrim filter string tail, =chop () LTrim filter string header. The key in the filter string can only be used Str_replace . For example ...