change while loops with foreach

What do you think of the following:

```php
foreach ( array_keys($this->contents) as $products_id ) {
```
The same style could also be applied on lines 184, 199, 244, 259, 317, and 365.