SyntaxFix
Write A Post
Hire A Developer
Questions
Try this:
foreach($array as $k => $obj) { $obj->{'newKey'} = "value"; }