Latest web development tutorials

PHP FILTER_SANITIZE_STRIPPED filter

PHP Filter Reference Complete PHP Filter Reference

Definition and Usage

FILTER_SANITIZE_STRIPPED filter to remove unwanted characters or encoded.

The filter is FILTER_SANITIZE_STRING alias filter

The filter remove those applications potentially harmful data. It is used to remove the label and delete unwanted characters or encoded.

  • Name: "stripped"
  • ID-number: 513

Possible options or flags:

  • FILTER_FLAG_NO_ENCODE_QUOTES - This flag does not encode quotes
  • FILTER_FLAG_STRIP_LOW - removal of characters in the ASCII value of 32 or less
  • FILTER_FLAG_STRIP_HIGH - the removal of more than 32 characters in the ASCII value of
  • FILTER_FLAG_ENCODE_LOW - encoded characters in the ASCII value of 32 or less
  • FILTER_FLAG_ENCODE_HIGH - encoded ASCII value of the character above 32
  • FILTER_FLAG_ENCODE_AMP - the ampersand encoded as & amp;

Examples

<?php
$var="<b>Peter Griffin<b>";

var_dump(filter_var($var, FILTER_SANITIZE_STRIPPED));
?>

Output code is as follows:

string(13) "Peter Griffin"


PHP Filter Reference Complete PHP Filter Reference