How to deal with null value into "" double quotation marks, please

Source: Internet
Author: User
How to deal with null value into "" double quotation marks, Please {
"ReturnCode": "0 ",
"ReturnDesc": "Success ",
"ReturnData ":{
"List ":[
{
"Pkid": "1 ",
"Link_url ":"",
"Banner_path": "http://test.comn/Public/upload/headpic/adver/2015-12-03/565ff9b7350e6.jpg ",
"Model_type": null,
"Model_id": null
}
]
}
}


Reply to discussion (solution)

How does null come from?

How does null come from?

The default value of the database field is NULL.

How does null come from?


I tried
Foreach ($ list as $ key => $ value ){
Foreach ($ value as $ ke => $ val ){
If (empty ($ value [$ ke]) | is_null ($ value [$ ke]) {
$ Value [$ ke] = "";
}
}
}

Still not good


There are a lot of pain points in writing APP interfaces. you can write and judge on the json_encode side. Otherwise, it would be difficult to change the original model ..

You can only modify it on the copy. of course not.
Yes
$ List [$ key] [$ ke] = "";

Which of the three equal signs is equal to the total number.

if($a === null){    $a = '';)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.