• 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

PHP password_verify

Xdebug can't connect back to Docker host

How can I solve "laravel/horizon v1.1.0 requires ext-pcntl * -> the requested PHP extension pcntl is missing from your system"?

Zig-zag scan an N x N array

Utf8 encoding issue with Laravel

Laravel Model save() & update() Not Saving

SendGrid: Sending an email to multiple recipients without other emails being shown on the "to" field

Only on Firefox "Loading failed for the <script> with source"

Adding reCAPTCHA v2 into my PHP file

Symfony redirect if already loggedin from login page

Get all WooCommerce products within own plugin

Laravel Livewire: jQuery not working in child component loaded via @if statement

How to give apache permission to write to home directory?

How to display MySQL table using php and edit it in a web browser

How should I get started using PHPUnit as a testing framework for a bunch of functions and classes I have already made?

About Contact Privacy policy Terms and conditions