• 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

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'posts.post' doesn't exist

How can I access an array/object?

Uploading video to Youtube using Youtube Data API V3 and Google API Client PHP -- getting 401 (unauthorized) message

How to create custom authentication in laravel 8?

PHP: set a (deep) array key from an array [closed]

WordPress - Dynamically add user ID to the end of a URL

PHP Form Not Inserting

Statement that checks whether a URL contains a particular path?

MySQL order by field in Eloquent

Assets not referencing to public folder (Laravel)

Transpose and flatten two-dimensional indexed array where rows may not be of equal length

How to submit a form when page loads using JavaScript?

Store / Website Column in Magento 2 Admin Grid - Custom Module

PHP Slim Framework request using withAttribute error

if statement inside concatenation

About Contact Privacy policy Terms and conditions