|
|
Tutorials » Php »
|
Topic |
What is addcslashes Function?
|
|
Explanation |
|
In PHP, this function is used to return a string with slashes in front of the specified characters.
Syntax:
addcslashes(string,characters)
In the above syntax according to the "characters" specified, the slashes are added before the "string".
Example:
<?php
$s = "hi,how are you,my name is mike manning.";
echo addcslashes($s,'m')."<br />";
echo addcslashes($s,'h')."<br />";
?>
Result:
hi,how are you,\my na\me is \mike \manning
\hi,\how are you,my name is mike manning
In the above example the slashes are added before the string "m", "h".
|
|
A Note |
Learn PHP programming language tutorial with simple and neat example. Hope you enjoy this free tutorial.
Do give us your valuable feedback and suggestions on this online tutorial. This is a Copyright Content.
|
|
|
|