I have two arrays, both with the same indexes. What I want to do is loop through one of the arrays (portConfigArray), and change the value of an existing item by using data from a second array. (portStatusArray) Here's the logic:
$i=0;
foreach ($portConfigArray as $configentry)
{
$configentry['LinkState'] = $portStatusArray[$i]['LinkState'];
$i = $i + 1;
echo $configentry['LinkState'];
}
$portdetailsArray = $portConfigArray;
var_dump($portdetailsArray);
the echo statement shows the correct values being assigned for each item in the portConfigArray. (its just a string value like "Up" or "Down") But in the var_dump I can see that the value hasn't been updated correctly. It shows
["LinkState"]=> string(0) ""
as the output for each record.
Can you tell me what I'm doing wrong?