Created
February 16, 2015 10:43
-
-
Save rightgo09/4a26c87d1b3cc77f0d7c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$a = array(1,2,3); | |
$b = array(4,5,6); | |
foreach (array($a, &$b) as &$c) { | |
foreach ($c as &$d) { | |
$d *= 100; | |
} | |
} | |
print_r($a); | |
print_r($b); | |
//Array | |
//( | |
// [0] => 1 | |
// [1] => 2 | |
// [2] => 3 | |
//) | |
//Array | |
//( | |
// [0] => 400 | |
// [1] => 500 | |
// [2] => 600 | |
//) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment