PHP addcslashes() Function

The addcslashes() function is used to add backslashes in the sentances from specified character .

Demo :



Type Text Type Character  

Example :

Type sentance at textarea like this : PHP is a powerful language.Type Character at Text box like this : a

If you need to add slashes for a sentence following code useful to you.


<?php
$str = "PHP is a powerful language";
$result = addcslashes($str,a);
echo $result;
?>

In the above code is used to slashes for a sentance .The sentence will pass to the addcslashes() function.Finally output will display "PHP is \a powerful l\angu\age".

In the addcslashes() function have two parameters that name is string,characters. In the first parameters is used to assign the string and second parameters used to which letter will affected in the sentance.

Free Download Script :

If you need addcslashes() function demo code download from following link.

Download




Content