dsadsadsa1231 2012-02-22 12:40
浏览 70
已采纳

在没有json_encode的情况下制作json字符串

I'm stuck using an Apache server with an older php version. it doesn't have the function json_encode. does anybody know of a php script that can take care of this?

  • 写回答

2条回答 默认 最新

  • duanquannan0593 2012-02-22 12:48
    关注

    If it is absolutely not possible to upgrade your PHP, here are a few work arounds:

    Upgrade.php - With 'upgrade.php' on-hand, you can use many features from newer PHP versions (up to 5.3/5.4 currently) without losing compatibility to older interpreters and outdated webserver setups. It takes care of emulating any functions (with their original names) that are missing at runtime. You just include() it into your application. Then you're freed from micromanaging backwards compliance and wasting time with workarounds. Simply use the more featureful PHP functions.

    JSON-PHP - JSON-PHP is a PHP implementation of JSON, freely-available for download and use from pear.php.net.

    Json Wrapper - jsonwrapper implements the json_encode function if it is missing, and leaves it alone if it is already present. So it is nicely future-compatible.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 unity第一人称射击小游戏,有demo,在原脚本的基础上进行修改以达到要求
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?
  • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染