PHP Classes

IS PHP HTMLSpecialChars: Check if a HTML string contains special characters

Recommend this page to a friend!
  Info   View files Documentation   View files View files (3)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2021-12-17 (7 days ago) RSS 2.0 feedNot yet rated by the usersTotal: 45 This week: 45All time: 10,209 This week: 3Up
Version License PHP version Categories
is_htmlspecialchars 1.0GNU General Publi...5HTML, PHP 5, Searching
Description Author

This is a simple class that can check if an HTML string contains special characters.

It takes a string with HTML tags and searches it to find characters like < , > and & .

The class returns true if any HTML special characters are found.

Picture of Ali YILMAZ
Name: Ali YILMAZ <contact>
Classes: 5 packages by
Country: Turkey Turkey
Innovation award
Innovation award
Nominee: 2x

Details

What is is_htmlspecialchars ?

This package serves to check whether the data shared with it contains HTML special characters. The data must be specified in string type. Returns true if the HTML contains special characters, otherwise false.

data:

$code = 'merhaba &lt;?=$this-&gt;timestamp;?&gt;';

Out-of-class use:

code:

require_once('Mind.php');
if($m::aliyilmaz('is_htmlspecialchars')->is_htmlspecialchars($code)){
    echo 'HTML contains special characters.';
} else {
    echo 'HTML does not contain special characters';
}

When using it in the class:

code:

if(self::aliyilmaz('is_htmlspecialchars')->is_htmlspecialchars($code)){
    echo 'HTML contains special characters.';
} else {
    echo 'HTML does not contain special characters';
}

output:

HTML contains special characters.

Dependencies

This package has no dependencies.

License

Instructions and files in this directory are shared under the GPL3 license.

  Files folder image Files  
File Role Description
Files folder imagesrc (1 file)
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files  /  src  
File Role Description
  Plain text file is_htmlspecialchars.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:45
This week:45
All time:10,209
This week:3Up
For more information send a message to info at phpclasses dot org.