What is addslashes() function ?
The addslashes() function basically used to returns a string with backslashes before characters that need to be quoted in database queries.
Mostly it is used for predefined characters, addslashes() function is very useful when we try to insert strings into a database.
These predefined characters are:
single quote (')
double quote (")
backslash ()
You can take reference form below example
<?php
$addstr = addslashes('Hi how are you "Mac"?');
// here $addstr is a variable
echo($addstr); // now call the The addslashes() function
?>
output will come following:
Hi how are you \"Mac\"?
0 Comment(s)