mardi 18 juillet 2017

php json_decode VS Laravel Tinker json_decode

i have a problem about php json_decode, now i have a json string like this

"{\"client_id\":\"yunniao\",\"client_secret\":\"sdfW234eDtjkuDFityDu345JYyuk5Jom\",\"insurance_applicant_id\":1,\"policyholder\":\"\\u5317\\u4eac\\u4e91\\u4e2d\\u5c0f\\u9e1f\\u79d1\\u6280\\u6709\\u9650\\u516c\\u53f8\",\"ower_name\":\"\\u8bd7\\u6768\\u8fd0\\u529b\\u4e8c\",\"plate_no\":\"\\u4eacM00002\",\"trade_no\":\"2932848\",\"cargo_type\":\"\\u4e34\\u65f6\\u4efb\\u52a1-\\u6709SOP\",\"cargo_amount\":\"1-1\",\"cargo_number_min\":1,\"cargo_number_max\":1,\"start_place\":\"\\u5367\\u9f99\\u5c0f\\u533a\",\"end_place\":\"\\u4e3b\\u4efb\\u52a1-\\u6709SOP\",\"effect_date\":\"2017-07-01T00:08:44+08:00\",\"coverage\":100000,\"freight\":\"3000\"}"

is a very json string, 1. i put this in Laravel artisan tiker the above string return me like this:

    {
     +"client_id": "yunniao",
     +"client_secret": "sdfW234eDtjkuDFityDu345JYyuk5Jom",
     +"insurance_applicant_id": 1,
     +"policyholder": "北京云中小鸟科技有限公司",
     +"ower_name": "诗杨运力二"
}

  1. but in the php interactive command line, the json string give me null;

i'm tried a lot of possibilities;

  1. i tried to put above code in my Laravel project, then test the file, it give me null;
  2. i googled so many times, but there is no answer;

it's all failed, now i'm here, i think i want help! thanks for any help and workround.



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2u4VaYv
via IFTTT

Aucun commentaire:

Enregistrer un commentaire