nggit/php-xmlentities

将所有Unicode字符和字符引用转换为数字字符引用

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

This package is auto-updated.

Last update: 2024-09-05 19:14:48 UTC


README

PHP xmlentities

提示: 将此 md 文件重命名为 php 以在您的Web服务器上测试。

<?php

require 'src/NCR.php';

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

这些都是可移植的ASCII字符

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

?>

就这样!这个库不使用 mbstringiconv 扩展以提高更好的兼容性。