note 86997 added to function.json-decode

From: Date: Fri, 14 Nov 2008 03:39:02 +0000
Subject: note 86997 added to function.json-decode
Groups: php.notes 
Request: Send a blank email to php-notes+get-146510@lists.php.net to get a copy of this message
Make sure you pass in utf8 content, or json_decode may error out and just return a null value. For a particular web service I was using, I had to do the following: $contents = file_get_contents($url); $contents = utf8_encode($contents); $results = json_decode($contents); Hope this helps! ---- Server IP: 208.69.120.35 Probable Submitter: 24.245.27.77 ---- Manual Page -- http://www.php.net/manual/en/function.json-decode.php Edit -- https://master.php.net/note/edit/86997 Del: integrated -- https://master.php.net/note/delete/86997/integrated Del: useless -- https://master.php.net/note/delete/86997/useless Del: bad code -- https://master.php.net/note/delete/86997/bad+code Del: spam -- https://master.php.net/note/delete/86997/spam Del: non-english -- https://master.php.net/note/delete/86997/non-english Del: in docs -- https://master.php.net/note/delete/86997/in+docs Del: other reasons-- https://master.php.net/note/delete/86997 Reject -- https://master.php.net/note/reject/86997 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#146510) next »