Is there a more efficient way to set JSON array values than this?
for($i=0;$i<sizeOf($json['activity']);$i++){
$json['activity'][$i]['active'] = 'false';
}
I want to set all sub keys named 'active' to 'false' The arrays are not huge, they are multi-dimension with about 8-10 sub arrays and I am running on XAMPP localhost.
I am getting
Allowed memory size of 134217728 bytes exhausted (tried to allocate 32 bytes)
error briefly and then the rest of the code runs OK on a setInterval. I have looked at ways to set the memory limit but suspect there must be a cleaner way to set the array keys.
Thank you