I tested this script:
PHP Code:
<?php
$json = '[{"id":"2","value":"1"},{"id":"1","value":"1"},{"id":"3","value":""},{"id":"4", "value":""},{"id":"5","value":""},{"id":"6","value":"<br \/>"},{"id":"7","value":"<br \/>"},{"id":"8","value":"<br \/>"},{"id":"9","value":"<br \/>"},{"id":"10","value":"1"}]';
$decode = json_decode($json);
echo "json string: " . htmlentities($json) . "<br/><br/>";
echo "decoded: "; var_dump($decode);
?>
And it gave this result:
Code:
json string: [{"id":"2","value":"1"},{"id":"1","value":"1"},{"id":"3","value":""},{"id":"4", "value":""},{"id":"5","value":""},{"id":"6","value":"<br \/>"},{"id":"7","value":"<br \/>"},{"id":"8","value":"<br \/>"},{"id":"9","value":"<br \/>"},{"id":"10","value":"1"}]
decoded: array(10) { [0]=> object(stdClass)#1 (2) { ["id"]=> string(1) "2" ["value"]=> string(1) "1" } [1]=> object(stdClass)#2 (2) { ["id"]=> string(1) "1" ["value"]=> string(1) "1" } [2]=> object(stdClass)#3 (2) { ["id"]=> string(1) "3" ["value"]=> string(0) "" } [3]=> object(stdClass)#4 (2) { ["id"]=> string(1) "4" ["value"]=> string(0) "" } [4]=> object(stdClass)#5 (2) { ["id"]=> string(1) "5" ["value"]=> string(0) "" } [5]=> object(stdClass)#6 (2) { ["id"]=> string(1) "6" ["value"]=> string(6) "
" } [6]=> object(stdClass)#7 (2) { ["id"]=> string(1) "7" ["value"]=> string(6) "
" } [7]=> object(stdClass)#8 (2) { ["id"]=> string(1) "8" ["value"]=> string(6) "
" } [8]=> object(stdClass)#9 (2) { ["id"]=> string(1) "9" ["value"]=> string(6) "
" } [9]=> object(stdClass)#10 (2) { ["id"]=> string(2) "10" ["value"]=> string(1) "1" } }
So it should work.
Bookmarks