【发布时间】:2012-01-24 11:35:27
【问题描述】:
这可能很简单。但我就是想不出该怎么做。
我有一个照片上传脚本,我想在一个数组中返回两种类型的数据,现在我只有一组返回的照片数据。
现在我这样做:
$photos = array();
///Script for photo upload etc.
array_push($photos, $newPhotoToAdd)
//then when it's finished uploading each photo i do json_encode:
print json_encode($photos);
所有这些都很完美,但是现在我想为每张照片返回另一组数据。
我需要做类似的事情:
array_push($photos, ['photoID'] = $photoID, ['photoSource'] = $newPhotoToAdd)
【问题讨论】: