英[sl??]? ?美[sl??]??

vt.大幅削減;揮砍;鞭打;嚴(yán)厲批評(píng)

vi.猛砍;嚴(yán)厲地批評(píng)

n .斜線; 猛砍;刀痕,傷痕;沼澤低地

第三人稱單數(shù): slashes 複數(shù): slashes 現(xiàn)在分詞: slashing 過(guò)去式: slashed 過(guò)去分詞: slashed

php addcslashes()函數(shù) 語(yǔ)法

作用:傳回在指定字元前新增反斜線的字串

語(yǔ)法:addcslashes(string,characters)

參數(shù):

參數(shù)#描述
string?必須,規(guī)定要轉(zhuǎn)義的字串。
characters??必須,規(guī)定要轉(zhuǎn)義的字元或字元範(fàn)圍。? ??

?說(shuō)明:傳回已轉(zhuǎn)義的字串。

php addcslashes()函數(shù) 範(fàn)例

<?php
$str = "Welcome to php.cn!";
echo $str."<br>";
echo addcslashes($str,'m')."<br>";
echo addcslashes($str,'p')."<br>";
?>

運(yùn)行實(shí)例?

點(diǎn)擊"運(yùn)行實(shí)例"按鈕查看線上實(shí)例

輸出:

Welcome to php.cn!
Welco\me to php.cn!
Welcome to \ph\p.cn!