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

PHP addcslashes() 函數(shù)

定義和用法

addcslashes() 函數(shù)在指定的字符前添加反斜杠。

語法

addcslashes(string,characters)
參數(shù) 描述
string 必需。規(guī)定要檢查的字符串。
characters 可選。規(guī)定受 addcslashes() 影響的字符或字符范圍。

提示和注釋

注釋:在對(duì) 0,r,n 和 t 應(yīng)用 addcslashes() 時(shí)要小心。在 PHP 中,\0,\r,\n 和 \t 是預(yù)定義的轉(zhuǎn)義序列。

實(shí)例

例子 1

在本例中,我們要向字符串中的特定字符添加反斜杠:

<?php
$str = "Hello, my name is John Adams.";
echo $str;
echo addcslashes($str,'m');
echo addcslashes($str,'J');
?>

輸出:

Hello, my name is John Adams.
Hello, \my na\me is John Ada\ms.
Hello, my name is \John Adams.

例子 2

在本例中,我們要向字符串中的一個(gè)范圍內(nèi)的字符添加反斜杠:

<?php
$str = "Hello, my name is John Adams.";
echo $str;
echo addcslashes($str,'A..Z');
echo addcslashes($str,'a..z');
echo addcslashes($str,'a..h');
?>

輸出:

Hello, my name is John Adams.
\Hello, my name is \John \Adams.
H\e\l\l\o, \m\y \n\a\m\e \i\s J\o\h\n A\d\a\m\s.
H\ello, my n\am\e is Jo\hn A\d\ams.
芦山县| 织金县| 高要市| 庆城县| 中卫市| 繁峙县| 万全县| 公主岭市| 余庆县| 察隅县| 大渡口区| 仁化县| 屏南县| 林甸县| 万安县| 明光市| 曲阳县| 新兴县| 攀枝花市| 育儿| 普宁市| 普定县| 那曲县| 玉田县| 连山| 封丘县| 洪雅县| 扶余县| 遂川县| 上犹县| 荣成市| 沁水县| 寻乌县| 赞皇县| 贵州省| 西贡区| 理塘县| 杭锦后旗| 布拖县| 甘谷县| 汪清县|