How to use FILTER SANITIZE MAGIC QUOTES in PHP

This article describe about FILTER_SANITIZE_MAGIC_QUOTES Filter in PHP.
  • 3257

FILTER_SANITIZE_MAGIC_QUOTES Filter

The addslashes() function perform to a string by FILTER_SANITIZE_MAGIC_QUOTES Filter.

Sets backslashes in front of predefined characters by this filter.

The predefined characters are:

  • backslash (\)
  • NULL
  • single quote (')
  • double quote (")

FILTER_SANITIZE_MAGIC_QUOTES info:

  • Name: "magic_quotes"
  • ID-number: 521
     

Example

<html>
<body>
<?php
$var="Satya's here!";
var_dump(filter_var($var, FILTER_SANITIZE_MAGIC_QUOTES));
?>
</body>
</html>

Output

filtersanitizemagicquotesphp.jpg

You may also want to read these related articles Click here

Ask Your Question 

Got a programming related question? You may want to post your question here

Programming Answers here

Categories

More Articles

© 2020 DotNetHeaven. All rights reserved.