• 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 make autocomplete work in foreach php loop? (vscode, intellisense)

How to update array value in Laravel

Why do I have invalid argument supply for foreach in Laravel for json response? [duplicate]

Login if user is active using Laravel Breeze

WooCommerce: Add/display Product or Variation custom field everywhere

How to add a sidebar to Woocommerce Shop Page?

woocommerce change position of price

Show rotation of tweets using current day of month

wp_remote_get() not passing authentication

Call to a member function fetch_field() on a non-object MySQLiDB

Reorder attribute dropdown terms in Woocommerce single variable products

Laravel websockets AWS EC2 - Connection failed

How to get Laravel's CSRF Token from Another Website?

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

How to loop sql table data inside a html table

About Contact Privacy policy Terms and conditions