英[slæʃ] 美[slæʃ]

vt.Severely cut; slash; whip; severely criticize

vi.Severely chop; severely criticize

n .slash; slash; slash, scar; swamp lowland

Third person singular: slashes Plural: slashes Present participle: slashing Past tense: slashed Past participle: slashed

php addcslashes() function syntax

Function: Returns a string with a backslash added before the specified character

Syntax: addcslashes(string,characters)

Parameters:

ParametersDescription
string Required, specifies the string to be escaped.
characters Required, specifies the characters or character range to be escaped.​

Description: Returns the escaped string.

php addcslashes() function example

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

Run instance»

Click the "Run instance" button to view the online instance

Output:

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