9
$a = '[{"function":"error_handler","class":"LP","type":"::","args":[256,"Call to undefined method LP_pdo::get_rorzxx() on D:\\MARK\\htdocs\\lessphptest\\application\\controllers\\users.php (23)","D:\\MARK\\htdocs\\lessphp\\LP.php",210,{"e":{"type":1,"message":"Call to undefined method LP_pdo::get_rorzxx()","file":"D:\\MARK\\htdocs\\lessphptest\\application\\controllers\\users.php","line":23}}]},{"file":"D:\\MARK\\htdocs\\lessphp\\LP.php","line":210,"function":"trigger_error","args":["Call to undefined method LP_pdo::get_rorzxx() on D:\\MARK\\htdocs\\lessphptest\\application\\controllers\\users.php (23)",256]},{"function":"shutdown","class":"LP","type":"::","args":[]}]';
$a = json_decode($a);
print_r($a);

echo json_last_error();

print_r()空白を返します。

json_last_error()4を返します。JSON_ERROR_SYNTAX

しかし、http://jsonlint.com/でjson文字列を実行するValid JSON

なぜ何かアイデアはありますか?

4

2 に答える 2

12

\PHPの場合は一度エスケープし、JSONの場合はもう一度エスケープする必要があります

D:\\\\....

于 2012-07-31T11:05:08.693 に答える
0

エンコーディングをutf-8に設定してみてください...私のために仕事をしました

于 2012-07-31T11:11:12.980 に答える