html实体为数字的,如何转为字符?
用mb_convert可以,但是为什么html_entity_decode不可以?

解决方案 »

  1.   


    //有什么问题?
    echo html_entity_decode('’');
      

  2.   

    因为它实际上不是单引号!
    我们通常用的单引号是39英文引号有多种, 请参考此文:
    http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
      

  3.   

    $s = '’';
    echo $text = mb_convert_encoding($s , "utf-8", 'HTML-ENTITIES'); 
    out:’
      

  4.   

    htmlspecialchras_decode转出来的double quotes是unicode吧,唠叨的方法转出来是utf8,可以linux下查看。