Parsing Javascript (not JSON) in PHP

后端 未结 5 1581
[愿得一人]
[愿得一人] 2020-12-01 11:06

I have a php string containing the serialization of a javascript object :

$string = \'{fu:\"bar\",baz:[\"bat\"]}\';

The actual string is fa

5条回答
  •  执笔经年
    2020-12-01 12:01

    Pear Services_JSON will parse that string (tested version 1.31). But given that that is a JSON parser and that this isn't valid JSON you have no guarantee that future versions will still work.

提交回复
热议问题