I have 2 arrays.
$result = array();
$row = array();
Row\'s elements are all references and is constantly changing. For each iteration of
Extending the function above like follows solved a problem I had:
function array_copy($source) {
$arr = array();
foreach ($source as $element) {
if (is_array($element)) {
$arr[] = array_copy($element);
} elseif (is_object($element)) {
// make an object copy
$arr[] = clone $element;
} else {
$arr[] = $element;
}
}
return $arr;
}