PHP snippets: update foreach.