note 127555 added to function.mb-decode-numericentity

From: Date: Mon, 29 Aug 2022 23:41:01 +0000
Subject: note 127555 added to function.mb-decode-numericentity
Groups: php.notes 
Request: Send a blank email to php-notes+get-219496@lists.php.net to get a copy of this message
<?php // the following documentation depending on understanding of the code source of php mbr // first in order to optimise the work of php // the string must contain "&" or else php won't bother trying to decode. // for the map : int start_codeN, int end_codeN, int offsetN, int maskN // the entity must be in the range [start_codeN, end_codeN] , if the entity is greater or less // mb_decode_numericentity will ignore the decode process and return the $string as it is. // in the late version of php, $map : "must have a multiple of 4 elements" $map = [ 0x0, 0xFFFF, 0, 0]; echo mb_decode_numericentity('&#109;', $map ); // result "m" // if offsetN = 1 result "l" ; the more you increase the decimal the more it use OR operrand. $map_2 = [ 0x0, 0xFFFF, 60, 0]; echo mb_decode_numericentity('&#109;', $map_2 ); // decode ( &#49; ) result : "1" // entity Reference to check the result : https://cs.stanford.edu/people/miles/iso8859.html#ISO ?> ---- Server IP: 45.112.84.4 Probable Submitter: 185.85.3.173 (proxied: 41.99.215.167) ---- Manual Page -- https://php.net/manual/en/function.mb-decode-numericentity.php Edit -- https://main.php.net/note/edit/127555 Del: integrated -- https://main.php.net/note/delete/127555/integrated Del: useless -- https://main.php.net/note/delete/127555/useless Del: bad code -- https://main.php.net/note/delete/127555/bad+code Del: spam -- https://main.php.net/note/delete/127555/spam Del: non-english -- https://main.php.net/note/delete/127555/non-english Del: in docs -- https://main.php.net/note/delete/127555/in+docs Del: other reasons-- https://main.php.net/note/delete/127555 Reject -- https://main.php.net/note/reject/127555 Search -- https://main.php.net/manage/user-notes.php

« previous php.notes (#219496) next »