我有一个json字符串,包含像+,-,“,'这样的特殊字符。当我尝试对字符串使用json\u解码时,解码在+符号处中断。+符号后的内容没有解码。
我的代码如下:
//Example string $str = '{"image":"wo7898Ee/fp+18mtyeex//Z"}'; $res = json_decode($str, true);
我的输出是打印到/fp。最后一个字符被截断并显示解码输出为。。。
请帮忙
$str = '{ "image": "wo7898Ee/fp+18mtyeex//Z" }'; $res = json_decode($str, true); print_r($res['image']);
输出为: wo7898Ee/fp+18mtyeex//Z
wo7898Ee/fp+18mtyeex//Z