Download the PHP package gavinggordon/htmlentities without Composer
On this page you can find all versions of the php package gavinggordon/htmlentities. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download gavinggordon/htmlentities
More information about gavinggordon/htmlentities
Files in gavinggordon/htmlentities
Package htmlentities
Short Description A PHP class which allows the decoding and encoding of a wider variety of characters compared to the standard htmlentities and html_entity_decode functions.
License MIT
Homepage http://htmlentities.gavingordon.com
Informations about the package htmlentities
HtmlEntities v4.1
Description
The ability to encode and decode a certain set of characters called 'Html Entities' has existed since PHP4. Amongst the vast number of functions built into PHP, there are 4 nearly identical functions that are used to encode and decode html entities; despite their similarities, however, 2 of them do provide additional capabilities not available to the others.
Encoding Functions | Decoding Functions |
---|---|
htmlentities¹ | html_entity_decode¹ |
htmlspecialchars² | htmlspecialchars_decode² |
¹ htmlentities and html_entity_decode can only encode and decode characters within PHP's HTML translations table.
² htmlspecialchars and htmlspecialchars_decode can only encode and decode special characters³.
³ special characters are not interpreted as HTML tags and 8-bit characters are encoded as ASCII characters only.
What Sets This Apart
What sets this class apart from the rest is that this class, in addition to being able to encode and decode all of the same characters/entities that can be encoded and decoded by PHP's htmlentities() and html_entity_decode() functions, it can also encode and decode a very large number of characters/entities which PHP's built-in htmlentities encoding and decoding functions won't encode/decode, due to their lack of special meaning in HTML, like:
- punctuation characters;
- ASCII characters;
- Greek characters;
- Latin characters;
- Russian characters;
- Arithmetic characters;
- and tons more...
Usage
Installation (via Composer)
Examples
Instantiation:
Encoding:
Decoding:
More Information
CodeClimate
Check out our CodeClimate stats by clicking here.
PHP Innovation Award
This class has been awarded a PHP Innovation Award, provided by PHPClasses.org. My other PHP classes are accessible online via my GitHub profile or PHPClasses.org profile.