nggit/php-xmlentities

Convert all Unicode characters and character references to numeric character references

Installs: 7

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/nggit/php-xmlentities

dev-master 2019-03-05 04:48 UTC

This package is auto-updated.

Last update: 2025-10-05 21:31:00 UTC


README

PHP xmlentities

Tip: Rename this md file to php to test it on your web server.

<?php

require 'src/NCR.php';

$str     = '<p> &copy; © with ❤ </p>';
$encoded = Nggit\PHPXMLEntities\NCR::encode($str);

These are portable ASCII characters

echo $encoded;
// Source view:
// <p> &#169; &#169; with &#10084; </p>
exit;

?>

That's it! This library doesn't use the mbstring or iconv extension for better compatibility.