• 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

image source not readable

Unable to get password for the instance created from AMI

file_get_contents() without "Http" to access external URL [closed]

Timber: Single post pagination does not work (wp_link_pages)

Laravel 8 Multiple Relationships for Factory

Update Total in checkout of Woocommerce with Ajax Request

If you intend you use SMTP, add your SMTP Code after this Line

PHP contact form configuration [duplicate]

Login if user is active using Laravel Breeze

Unit (real unit test) of test laravel relationship

CodeIgniter 4: Like and Dislike Functionality

Laravel relationship belongsToMany with composite primary keys

How can I make this nested location configuration use the correct path to call a php program?

How do I call Validator from a namespace with an already existing Validator class

How to upload mpdf file after generating to s3 bucket in php

About Contact Privacy policy Terms and conditions