最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

PHP trim() 函數(shù)

定義和用法

trim() 函數(shù)從字符串的兩端刪除空白字符和其他預(yù)定義字符。

語法

trim(string,charlist)
參數(shù) 描述
string 必需。規(guī)定要檢查的字符串。
charlist 可選。規(guī)定要轉(zhuǎn)換的字符串。如果省略該參數(shù),則刪除以下所有字符:
  • "\0" - NULL
  • "\t" - tab
  • "\n" - new line
  • "\x0B" - 縱向列表符
  • "\r" - 回車
  • " " - 普通空白字符

例子

例子 1

<html>
<body>
<?php
$str = "    Hello World!    ";
echo "Without trim: " . $str;
echo "<br />";
echo "With trim: " . trim($str);
?>
<body>
<html>

輸出:

Without trim: Hello World!
With trim: Hello World!

HTML 源碼:

<html>
<body>
Without trim:     Hello World!    <br />With trim: Hello World!
</body>
</html>

例子 2

<?php
$str = "\r\nHello World!\r\n";
echo "Without trim: " . $str;
echo "<br />";
echo "With trim: " . trim($str);
?>

輸出:

Without trim: Hello World!
With trim: Hello World!

HTML 源碼:

<html>
<body>
Without trim: 
Hello World!
<br />With trim: Hello World!
</body>
</html>
仙游县| 德安县| 东乡族自治县| 米林县| 福清市| 崇明县| 肇庆市| 建平县| 沂水县| 岚皋县| 元朗区| 互助| 佛冈县| 华阴市| 邢台县| 靖西县| 潮州市| 拉萨市| 静宁县| 西乌珠穆沁旗| 西安市| 永康市| 辽阳市| 和龙市| 聂荣县| 涟源市| 清流县| 梅河口市| 葫芦岛市| 临漳县| 于田县| 罗平县| 乐昌市| 漯河市| 太和县| 通河县| 育儿| 玛沁县| 凤冈县| 牡丹江市| 额敏县|