Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
好吧,我得到了这个序列化的 PHP 字符串:a:1:{s:10:"max_photos";i:10;}有没有办法用 JavaScript 来反序列化它?
a:1:{s:10:"max_photos";i:10;}
您可以使用php.js库,或者简单地复制相关部分,尽管您可能应该使用 Pekka 提到的 json_encode()。