我有这些数组
$address = array("1JzSZFs2DQke2B3S4pBxaNaMzzVZaG4Cqh", "12Cf6nCcRtKERh9cQm3Z29c9MWvQuFSxvT", "1dice6YgEVBf88erBFra9BHf6ZMoyvG88")
$amount= array("100000000","150000000","200000000")
我希望将它们转换为json格式,如下所示:
{
"1JzSZFs2DQke2B3S4pBxaNaMzzVZaG4Cqh": 100000000,
"12Cf6nCcRtKERh9cQm3Z29c9MWvQuFSxvT": 1500000000,
"1dice6YgEVBf88erBFra9BHf6ZMoyvG88": 200000000
}
我尝试了太多,但无法弄清楚如何在PHP中做到这一点,任何想法?
答案 0 :(得分:2)
echo json_encode(array_combine($address, array_map('intval', $amount)));