我在php数组中有数据库查询结果如下:
Array
(
[status] => 1
[message] => Successfully Login
[request] => Array
(
[firstName] => Jugni
[lastName] => Patel
[popup_message] => To login to this portal you have to agree out terms and condition
• L80 – R169 pm x 24 on SMARTCHAT 1GB
• G3 Beat – R259 pm x 24 on SMARTCHAT 1GB
• G3 – R399 pm x 24 on SMARTCHAT 1GB
Top 5 MTN Sales consultants for period 2-8 March 2015, on G3 & G3 Beat sales will WIN R500 each! You have until Monday 9 March 9AM to log your sales for this competition!
)
)
当我在做上面数组的json_encode时,它在描述中给出了空值。
{"status":"1","message":"Successfully Login","request":{"firstName":"Jugni","lastName":"Patel","popup_message":null}}
更新
现在我可以使用utf8_encode方法获取描述的值。 但是当我再次使用json_decode对该字符串进行解码时,它会给出以下输出:
它给出如下解码值:
stdClass Object
(
[status] => 1
[message] => Successfully Login
[request] => stdClass Object
(
[firstName] => Jugni
[lastName] => Patel
[popup_message] => To login to this portal you have to agree out terms and condition
• L80 – R169 pm x 24 on SMARTCHAT 1GB
• G3 Beat – R259 pm x 24 on SMARTCHAT 1GB
• G3 – R399 pm x 24 on SMARTCHAT 1GB
Top 5 MTN Sales consultants for period 2-8 March 2015, on G3 & G3 Beat sales will WIN R500 each! You have until Monday 9 March 9AM to log your sales for this competition!
)
)
有谁知道如何在json_encode之后获得相同的描述字段值?