Convert hex to ascii characters

前端 未结 5 1067
攒了一身酷
攒了一身酷 2020-12-03 15:12

Is it possible to represent a sequence of hex characters (0-9A-F) with a sequence of 0-9a-zA-Z characters, so the the result sequence is smaller and can be decoded?

5条回答
  •  南方客
    南方客 (楼主)
    2020-12-03 15:24

    I think you're looking for this:

    function hex2str($hex) {
        $str = '';
        for($i=0;$i

    (From http://www.linux-support.com/cms/php-convert-hex-strings-to-ascii-strings/) (Works like this javascript tool: http://www.dolcevie.com/js/converter.html)

提交回复
热议问题