CodeIgniter Forums
we are using json php with codeigniter with a webservice and the problem its the & character - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: we are using json php with codeigniter with a webservice and the problem its the & character (/showthread.php?tid=58257)



we are using json php with codeigniter with a webservice and the problem its the & character - El Forum - 05-28-2013

[eluser]dinisptc[/eluser]
we are using json php with codeigniter with a webservice and the problem its the & character

this is the json that we are sending to the server
Code:
'data'=>'{
  "rep_front" : 1,
  "rep_content" : 0,
  "meetingUID" : "meeting_51912eb04eb45",
  "projectUID" : "project_51912b6023998",
  "rep_sorting" : 1,
  "rep_images" : 1,
  "footer_text" : "Footer text test...\"",
  "header_text" : "Teste header\" roof & window"
}');

at the server iam doing json_decode

Code:
$j = json_decode($json,true);

i have tried

Code:
$result = utf8_encode($json); // before json_decode

but its not working

thanks




we are using json php with codeigniter with a webservice and the problem its the & character - El Forum - 05-28-2013

[eluser]dinisptc[/eluser]
$result = utf8_encode($json); // before json_decode
$j = json_decode($result);

its working now