How to use FILTER UNSAFE RAW in PHP

This article describe about FILTER_UNSAFE_RAW Filter in PHP.
  • 3881

FILTER_UNSAFE_RAW Filter

This filter does nothing, or encodes and strips defined characters.

And also removes data which is harmful for application.

It is used for encode unwanted characters or strip tags and remove.

If flags no specified then this filter does nothing.

  • Name: "unsafe_raw"
  • ID-number: 516

Possible flags:

  • FILTER_FLAG_ENCODE_LOW - Encode characters with ASCII value below 32
  • FILTER_FLAG_ENCODE_HIGH - Encode characters with ASCII value above 32
  • FILTER_FLAG_STRIP_LOW - Strip characters with ASCII value below 32
  • FILTER_FLAG_STRIP_HIGH - Strip characters with ASCII value above 32
  • FILTER_FLAG_ENCODE_AMP - Encode the & character to &

Example

<html>
<body>
<?php
$file="file'";
echo filter_var($file,FILTER_UNSAFE_RAW);
?>
</body>
</html>

Output

filterunsaferawphp.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.