Is there a function to make a copy of a PHP array to another?
I have been burned a few times trying to copy PHP arrays. I want to copy an array defined inside an obj
In php array, you need to just assign them to other variable to get copy of that array. But first you need to make sure about it's type, whether it is array or arrayObject or stdObject.
For Simple php array :
$a = array( 'data' => 10 ); $b = $a; var_dump($b); output: array:1 [ "data" => 10 ]