PHP dereference array elements
问题 I have 2 arrays. $result = array(); $row = array(); Row's elements are all references and is constantly changing. For each iteration of $row I want to copy the values of row into an entry of $result and not the references. I have found a few solutions but they all seem rather awful. $result[] = unserialize(serialize($row)); $result[] = array_flip(array_flip($row)); Both of the above work but seem like a lot of unnecessary and ugly code just to copy the contents of an array of references by