php chop() function
Translation results:
英[tʃɒp] 美[tʃɑ:p]
v. Chop, chop; slam downward; lower; terminate
n. Spare ribs; chop, chop; palm chop ;Around the mouth
Third person singular: chops Plural: chops Present participle: chopping Past tense: chopped Past participle: chopped
php chop() functionsyntax
What does the chop() function mean?
php The chop function is an alias of the rtrim function. Its function is the same as the rtrim function. It deletes spaces or other predefined characters on the right side of the string. The syntax is chop(string,charlist) and returns the charlist. The string processed by the rules
Function:The chop function is an alias of the rtrim function. Its function is the same as the rtrim function. It deletes spaces or other predefined characters on the right side of the string
Syntax: chop(string,charlist)
Parameters:
Parameters | Description |
string | String to be processed |
charlist | Optional, Specifies which characters are to be removed from the string. If it is empty, all the following characters are removed. "\0" -- NULL, "\t" -- tab character, "\n" -- newline, "\x0B" -- Vertical tab character, "\r" -- Carriage return, " " -- Space |
Description: Returns after processing by charlist rules String
php chop() functionexample
<?php $i = "hello world "; echo "未经过处理的".$i."右边是有空格的!"; $j = chop($i); echo "经过处理的".$j."右边是没有空格的!"; ?>
Run instance»
Click the "Run instance" button to view the online instance
Output:
未经过处理的hello world 右边是有空格的!经过处理的hello world右边是没有空格的!