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.
我怎样才能得到这样的数组:
$array = array( "test1" => "blah1", "test2" => "blah2", );
转换成这样的字符串:
$string = {"test1":"blah1","test2":"blah"}
数组的大小可能会有所不同,因此它必须是动态的。
提前谢谢。
这是 JSON。使用json_encode().
json_encode()