php trim removes space characters and specified characters_PHP tutorial

WBOY
Release: 2016-07-20 11:02:30
Original
1189 people have browsed it

I didn’t look at the trim function before and thought it could only delete blanks. Today I discovered that it can also delete "�" - null
"t" - tab
"n" - new line
"x0b" - vertical list character
"r" - carriage return
" " - normal whitespace character
And user-specified characters.

$str = "##Use the trim function to remove specific characters at both ends of the string####";
$str1 = trim($str,"#"); //Pass in the second parameter to the function trim. Trim will delete the # characters
at both ends of the string $str. echo $str."
";
echo $str1;
?>

?>


www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/445376.htmlTechArticleI didn’t look at the trim function before and thought it could only delete blanks. Today I discovered that it can also delete - null t - tab n - new line x0b - vertical list character r - carriage return - ordinary whitespace characters and user-specified...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!