PHP rtrim function Detailed

Summary: PHP rtrim function Detailed


When using this function, read the explanation of w3school:

PHP RTRIM () function chop () function deletes a blank character or other predefined character from the end of the string.

Syntax: rtrim (string, charlist)

deleted right whitespace difficult to understand, difficult to understand that behind the charlist.

One example did finally find the answer.

eg: $ A = rtrim ( " Hello World", "ABCdAlB");

the final output value of the $ A should be: "Hello Wor" Why?

"ABCdAlB" This One series, will, from the right in order to replace and delete Hello World One look at the letters

1, ABC is not in line with the World "d", so to ABCd until the "d" appears, then "ABCd" the hello World becomes: hello Worl

2, ABCd after use, can not be reused, it took the "AlB" will work, so the order "AlB" only the middle "l" to "Worl" in the "l" effective.

There are doubts friends, carefully understand the function under the One.

I lie like a fly in a glass, the future is bright, but can not find a way out ......

Original: Big Box  PHP rtrim function Detailed


Guess you like

Origin www.cnblogs.com/chinatrump/p/11513122.html