i have such code:
($j = 0; $j < mysql_num_rows($subcategoriesdata); $j++) { $subcategoriesstrresult = mysql_fetch_array($subcategoriesdata); //echo $subcategoriesstrresult['title']."<br>"; $itemfeatures = array( $subcategoriesstrresult['title'] => $subcategoriesstrresult['path']); array_push($arraydatasubcategoryitems, $itemfeatures); }; array_push($mainarrayforjson, $item = array( 'parent_id' => $subcategoriesstrresult['parent'], 'level' => $subcategoriesstrresult['level'], 'items' => $arraydatasubcategoryitems )); after $mainarrayforjson ready i'm trying check json-code simple echo
echo json_encode($mainarrayforjson); meanwhile, sure need i'm checking single value of string echo (this string commented now) - works ok, see on chrome readable text (in database text stored in utf8, of course).
but last call echo check prepared json leads me next output:
[{"parent_id":"8-590","level":"3","items":[{"\u041c\u0435\u0442\u0430\u043b\u043b\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043b\u043e\u0442\u043e\u043a baks (\u041f\u043e\u043b\u044c\u0448\u0430)":"8-590-1404"},{"\u041c\u0435\u0442\u0430\u043b\u043b\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043b\u043e\u0442\u043e\u043a inpuk so, have no idea how fix - tried hardcode utf-coding "set names ..." , called header(), , iconv() - last has no sense becouse of i'm sured text in utf8.
please, help, thanks.
if want output text on web page, use javascript. , you'll russian characters. example:
<script type="text/javascript"> var = "\u041c\u0435\u0442\u0430\u043b\u043b\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043b\u043e\u0442\u043e\u043a baks (\u041f\u043e\u043b\u044c\u0448\u0430"; alert(a); </script> outputs this:

Comments
Post a Comment