• Categories
    • PHP
    • phpMyAdmin
    • PHPMailer
    • FFMpeg
    • PHPEXcel
    • PHPDoc
    • PHPUnit
    • CakePHP
    • CakePHP 2.0
    • Cake PHP 2.1
    • CakePHP Model
    • Facebook PHP SDK
    • composer-php
    • PHP 7
    • PHP GD
    All Categories
  • About

PHP: convert all UTF-8 characters to HTML entities

phputf-8


PHP Snippet 1:

echo encodespecial('? ? Hello World ? ? ? this is a test....');
function encodespecial($str) {
    $convmap = array(0x80, 0xfffffff, 0, 0xfffffff);
    return mb_encode_numericentity($str, $convmap, 'UTF-8');
}

Related Snippets

How to redirect to another page after n seconds in wordpress without using javascript?

How to convert binary string to normal string in php

Mysqli multi query error

Laravel eloquent update record without loading from database

PHP Slim Framework request using withAttribute error

Adding Multiple Custom Post Types in Wordpress

WooCommerce Additional Information - if empty, hide

how to prevent float variables displaying as scientific notation when printing [duplicate]

Dynamic table in HTML using MySQL and php

How to find phpcs current default standard

How to install php yaml on CentOs?

Adding custom body class to the custom archive pages

Docker & Laravel : configure: error: Package requirements (oniguruma) were not met

How to increase the PHP upload limits [duplicate]

How do I refresh a DIV content?

About Contact Privacy policy Terms and conditions