- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
FILTER_SANITIZE_SPECIAL_CHARS constant in PHP
The FILTER_SANITIZE_SPECIAL_CHARS constant filter HTML-escapes special characters.
Flags
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_HIGH − Encode characters with ASCII value above 32
Return
The FILTER_SANITIZE_SPECIAL_CHARS constant does not anything.
Example
<?php $var = "Favorite Sports is Football & Cricket?"; var_dump(filter_var($var,FILTER_SANITIZE_SPECIAL_CHARS)); ?>
Output
The following is the output.
string(43) "Favorite Sports is Football & Cricket?"
Advertisements