<?php $arr = array ('aa'=>1,'ab'=>2,'ac'=>3,'d'=>4); echo json_encode($arr); ?>

输出:{"aa":1,"ab":2,"ac":3,"d":4}