background image

 


 

public

 

static

 

function

 _convertToHtmlEntities(

$data

) { 

if

 (

is_array

(

$data

)) { 

$chars

=

str_split

(iconv(self::

$_convertToHtmlEntitiesSrcEncoding

,"UCS-2BE",

$data

[0]),2); 

$chars

=

array_map

(

array

(

__CLASS__

,

__FUNCTION__

),

$chars

); 

return

 join("",

$chars

); 

else

 { 

$code

=hexdec(sprintf("%02s%02s;",

dechex

(ord(

$data

 {0})),

dechex

(ord(

$data

 {1})))); 

return

 sprintf("&#%s;",

$code

);