can I get the unicode value of a character or vise versa with php?

后端 未结 5 1327
北恋
北恋 2020-11-27 03:35

Is it possible to input a character and get the unicode value back? for example, i can put ⽇ in html to output \"⽇\", is it possible to give that character as an a

5条回答
  •  北海茫月
    2020-11-27 04:14

    You can use the following functions

    For encoding

    string utf8_encode ( string $data )
    

    http://php.net/manual/en/function.utf8-encode.php

    For decoding

    string utf8_decode ( string $data )
    

    http://php.net/manual/en/function.utf8-decode.php

    Also check

    http://php.net/manual/en/function.htmlspecialchars.php

    
    

提交回复
热议问题