PHP addslashes Function

What is addslashes() Function?


The addslashes() function is used to return a string with slashes in front of the predefined characters like (',", , NULL).



In the above syntax the slashes are added before the "characters" specified in the "(string)" .

Example :

$s = "hi how'ss life.";
echo addslashes($s)."<br/>";
Result :

hi how'ss life.

In the above example the back slashes are added before the character "'".

PHP Topics

Ask Questions

Ask Question