• 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

nginx err_connection_refused, can anyone help me?

Laravel update hasMany relationship using saveMany

How to get the total hour from starting time to end time in php

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

php file upload scanning using clamav, permissions on /tmp/

disable two buttons after clicking another button

echo language construct is discouraged. (PHP)

Fatal error: Uncaught TypeError: count(): Argument #1 ($var) must be of type Countable|array, null given in

How to run or debug php on Visual Studio Code (VSCode)

How to install ZeroMQ for PHP on an Alpine Linux container?

Group rows by column and sum another column within groups [duplicate]

Laravel query builder binding parameters more than once

Inserting Country Selection into MySQL PHP [duplicate]

How to find the date a user created their Google account

How to get page number on dompdf PDF when using "view"

About Contact Privacy policy Terms and conditions