|
|
Tutorials » Php »
|
Topic |
What is addslashes() Function?
|
|
Explanation |
|
The addslashes() function is used to return a string with slashes in front of the predefined characters like (',", \, NULL).
Syntax:
addslashes(string)
In the above syntax the slashes are added before the "characters" specified in the "(string)" .
Example:
<?php
$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 "'".
|
|
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.
|
|
|
|