I have database query result in php array as below:
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!
)
)
When i am doing json_encode of above array then it is giving null value in description.
{"status":"1","message":"Successfully Login","request":{"firstName":"Jugni","lastName":"Patel","popup_message":null}}
Update:
Now i am able to get the value of description using utf8_encode method. But when i am again decoding that string using json_decode then it is giving below output:
It giving decode value as below:
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!
)
)
Does anybody know how can i get same value of description field after json_encode?
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">on top of your page outside the php tag.