Note Submitter: yarco dot w at gmail dot com
----
Well, I'm very pleased to share my knowledge on reference
and array.
What do you think the following code?
<?php
$array1 = array(1 => 'One', 2 =>
'Two_Will_Be_Changed', 3 => 'Three');
// $p = & $array1[2]; line 1
$array2 = $array1;
// $p = & $array1[2]; line 2
$array2[2] = 'Changed';
print_r($array1);
print_r($array2);
?>
The result of the code?
If uncomment line 1, the result of the code?
And if line2?
So, now you know what i'm saying, are you?
--
PHP Notes Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php
|