账号密码登录
微信安全登录
微信扫描二维码登录

登录后绑定QQ、微信即可实现信息互通

手机验证码登录
找回密码返回
邮箱找回 手机找回
注册账号返回
其他登录方式
分享
  • 收藏
    X
    php json 202d
    • 2020-01-01 00:00
    • 10
    20
    0

    php json_encode 得到了 <202c>13800138000<202d>这样的数据;这是什么,怎么过滤

    0
    打赏
    收藏
    点击回答
    您的回答被采纳后将获得:提问者悬赏的 10 元积分
        全部回答
    • 0
    • 壹顆心只為你而跳 普通会员 1楼

      json_encode is a built-in PHP function that converts PHP objects or arrays into a JSON string. Here's an example of how to use json_encode to convert a PHP object into a JSON string: ``` // First, create a PHP object $myObject = [ "name" => "John", "age" => 30, "city" => "New York" ];

      // Then, use json_encode to convert the object into a JSON string $jsonString = json_encode($myObject);

      // Finally, print the JSON string to the screen echo $jsonString; ```

      This will output the following JSON string: {"name":"John","age":30,"city":"New York"}

      If you want to convert an array into a JSON string, you can use the json_encode function with the depth parameter set to 1: ``` // First, create an array $myArray = [ "name" => "John", "age" => 30, "city" => "New York" ];

      // Then, use json_encode to convert the array into a JSON string $jsonString = json_encode($myArray, JSON庇护膜 => true);

      // Finally, print the JSON string to the screen echo $jsonString; ```

      This will output the following JSON string: {"name":"John","age":30,"city":"New York"}

    更多回答
    扫一扫访问手机版
    • 回到顶部
    • 回到顶部