在带有&符号的Codeigniter中的json_decode中不允许使用关键字符。

时间:2015-03-19 08:33:28

标签: php json codeigniter

我将一个字符串发送到包含&的控制器。当我执行json_decode时,它会返回该字符串中的Disallowed Key Characters。

例如:

"1204" : {
"phone" : {
  "0" : "666666"
},
"idcontact" : "1211",
"firstName" : "User1",
"address" : {
  "0" : {
    "State" : "Madrid",
    "Country" : "Spain",
    "City" : "Madrid"
  }
},
"urls" : {

},
"company" : "Restaurant & Cafe Bar",
"birthday" : "1987\/03\/09",
"email" : {
  "0" : "user@restaurant.com"
},
"job" : "Owner",
"lastName" : "LastName"}

它返回..

Disallowed Key Characters: Cafe Bar",
____"birthday" : "1987\/03\/09",
____"email" : {
______"0" : "user@restaurant.com"
____},
____"job" : "Owner",
____"lastName" : "LastName"}

我尝试更改函数_clean_input_keys($ str),但我不知道该怎么做。

我该如何解决?

1 个答案:

答案 0 :(得分:0)

您是否尝试过添加'&'在$config['permitted_uri_chars']的配置文件中?