英[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() function syntax
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() function example
<?php $i = "hello world "; echo "未經(jīng)過處理的".$i."右邊是有空格的!"; $j = chop($i); echo "經(jīng)過處理的".$j."右邊是沒有空格的!"; ?>
Run instance?
Click the "Run instance" button to view the online instance
Output:
未經(jīng)過處理的hello world 右邊是有空格的!經(jīng)過處理的hello world右邊是沒有空格的!