<?php
$a = " abc ";
$b = trim($a);
var_dump($a);
var_dump($b);
?>
trim(string,charlist)
charlist可选。规定从字符串中删除哪些字符。如果省略该参数,则移除下列所有字符:
- "\0" - NULL
- "\t" - 制表符
- "\n" - 换行
- "\x0B" - 垂直制表符
- "\r" - 回车
- " " - 空格
2023-12-18 11:55:10
<?php
$a = " abc ";
$b = trim($a);
var_dump($a);
var_dump($b);
?>
trim(string,charlist)
charlist可选。规定从字符串中删除哪些字符。如果省略该参数,则移除下列所有字符: