Guest User

Untitled

a guest
Jun 21st, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. <?php
  2.  
  3. $values = array(1,2,3);
  4. foreach ($values as &$value) {
  5. $value += 1;
  6. }
  7. print_r($values);
  8. foreach ($values as $index=>$value) {
  9. echo "{$index},{$value}\n";
  10. }
  11.  
  12. ## output
  13. Array
  14. (
  15. [0] => 2
  16. [1] => 3
  17. [2] => 4
  18. )
  19.  
  20. 0,2
  21. 1,3
  22. 2,3
Add Comment
Please, Sign In to add comment