Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $values = array(1,2,3);
- foreach ($values as &$value) {
- $value += 1;
- }
- print_r($values);
- foreach ($values as $index=>$value) {
- echo "{$index},{$value}\n";
- }
- ## output
- Array
- (
- [0] => 2
- [1] => 3
- [2] => 4
- )
- 0,2
- 1,3
- 2,3
Add Comment
Please, Sign In to add comment