how for loop works in php html code example Example: for each php <?php foreach (array(1, 2, 3, 4) as &$value) { $value = $value * 2; } ?>