mb_encode_numericentity

PHP 4 >= 4.0.6, PHP 5, PHP 7, PHP 8
mb_encode_numericentity - Encode character to HTML numeric string reference

mb_encode_numericentity(
     string$string,
     array$map,
     [string|null$encoding = null],
     [bool$hex = false]
): string

Converts specified character codes in string string from character code to HTML numeric character reference.

Parameters

string

The string being encoded.

map

map is array specifies code area to convert.

encoding

The encoding parameter is the character encoding. If it is omitted or null, the internal character encoding value will be used.

hex

Whether the returned entity reference should be in hexadecimal notation (otherwise it is in decimal notation).

Return Values

The converted string.

Changelog

Version Description
8.0.0 encoding is nullable now.

Related Functions

Example of mb_encode_numericentity

Show all examples for mb_encode_numericentity

PHP Version: