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 = '';)