如何复制其中有其他关联数组的数组? 我正在讨论从mysql_fetch_assoc
返回的结果集。创建一个结果行的副本
所以说,我有一个这样的结构...
connect
$result = query;
while ($row = mysql_fetch_assoc($result)) {
array_push($static_row, $row); // here lies the problem
}
我想获得的是$static_row
完全一样的$row
副本。最后,我想提出的一个功能,查询和while循环,并简单地返回$static_row
作为参考,$row
一个print_r
看起来像这样
Array ([key1] => value1 [key2] => value2)
Array ([key1] => value1 [key2] => value1)
谢谢, 让我知道如果你需要更多细节
+1这比'array_push'更好。 – Franz 2009-12-12 11:19:38