PHP addcslashes Function

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 name 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".

PHP Topics


Ask Questions

Ask Question