如何将Javascript数组转换为有效的JSON?

时间:2015-09-21 19:49:59

标签: javascript php arrays json type-conversion

我有一个以下类型的JavaScript数组(我不完全确定它是js-array):

RegionIds = [637640, 653240], countryIds = [621540, 803730], stamps = {
    metro: "f4f9c25",
    district: "2989c65",
    road: "411c27f",
    location: "cf2bf98",
    directions: "e1e21ec"
}

有没有方法可以将它转换为有效的JSON以便在php中使用?因此,对同一个php的理想解决方案。

0 个答案:

没有答案