• 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

Changing font color in javascript

woocommerce get_order_report_data to show order_item_id

Composer Warning: openssl extension is missing. How to enable in WAMP

mysql slow on updates for a well optimized query

How can I get user id from session in javascript?

Log a user out of a website when they put their computer to sleep

Laravel get user data with profile

ORA-12546: TNS:permission denied error connection to remote oracle server

Unit (real unit test) of test laravel relationship

Merge key and value of array index [duplicate]

Show Custom Data in Woocommerce Order Details Admin Area

Normalize DateInterval in PHP

How to get rid of ampersand using WP Nonce URL and WP Redirect or PHP header

Inserting Country Selection into MySQL PHP [duplicate]

php echo remove slashes from url [duplicate]

About Contact Privacy policy Terms and conditions