note 102178 added to function.json-encode
| From: | vakondweb at gmail dot com | Date: | Tue, 01 Feb 2011 09:01:40 +0000 |
| Subject: | note 102178 added to function.json-encode | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-176550@lists.php.net to get a copy of this message | ||
json_encode() only works with UTF-8 charset.
In case if you work with other charset, use this very simple solution instead of json_encode:
//$return_arr = the array of data to json encode
//$out = the output of the function
//don't forget to escape the data before use it!
$out = '["' . implode('","', $return_arr) . '"]';
----
Server IP: 69.147.83.197
Probable Submitter: 217.27.219.167
----
Manual Page -- http://www.php.net/manual/en/function.json-encode.php
Edit -- https://master.php.net/note/edit/102178
Del: integrated -- https://master.php.net/note/delete/102178/integrated
Del: useless -- https://master.php.net/note/delete/102178/useless
Del: bad code -- https://master.php.net/note/delete/102178/bad+code
Del: spam -- https://master.php.net/note/delete/102178/spam
Del: non-english -- https://master.php.net/note/delete/102178/non-english
Del: in docs -- https://master.php.net/note/delete/102178/in+docs
Del: other reasons-- https://master.php.net/note/delete/102178
Reject -- https://master.php.net/note/reject/102178
Search -- https://master.php.net/manage/user-notes.php