I iterate through an array of objects and want to delete one of the objects based on it\'s \'id\' property, but my code doesn\'t work.
foreach($array as $ele
It looks like your syntax for unset is invalid, and the lack of reindexing might cause trouble in the future. See: the section on PHP arrays.
The correct syntax is shown above. Also keep in mind array-values for reindexing, so you don't ever index something you previously deleted.