dongyou6909 2014-11-04 09:38
浏览 122
已采纳

如何在php中转换代码十进制值

I have string with Code Decimal and want convert like this:

Current sting:

24⃧ Guage Rake;

And want to convert like this:

24" Guage Rake

I have tried with this but not getting proper result:

$string = "hello&#8423";
htmlspecialchars_decode($string, ENT_NOQUOTES);

Any Idea?

Thanks

  • 写回答

2条回答 默认 最新

  • douxin2003 2014-11-04 09:45
    关注

    htmlspecialchars_decode() only changes a few characters like quotation marks.

    You need to use html_entity_decode() instead. Also, "hello&#8423" is missing a semicolon. Should be "hello⃧" "hello″".

    Try this:

    header("Content-Type: text/plain; charset=UTF8");
    $string = "hello″";
    $string = html_entity_decode($string, ENT_NOQUOTES);
    echo $string;
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 微信小程序商城如何实现多商户收款 平台分润抽成
  • ¥15 HC32L176调试了一个通过TIMER5+DMA驱动WS2812B
  • ¥15 cocos的js代码调用wx.createUseInfoButton问题!
  • ¥15 关于自相关函数法和周期图法实现对随机信号的功率谱估计的matlab程序运行的问题,请各位专家解答!
  • ¥15 Python程序,深度学习,有偿私
  • ¥15 扫描枪扫条形码出现问题
  • ¥35 poi合并多个word成一个新word,原word中横版没了.
  • ¥15 【火车头采集器】搜狐娱乐这种列表页网址,怎么采集?
  • ¥15 求MCSCANX 帮助
  • ¥15 机器学习训练相关模型