[ create a new paste ] login | about

Link: http://codepad.org/SvlasJ7f    [ raw code | output | fork ]

PHP, pasted on Oct 25:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<?php

$array = array('Old Value');
$lastarray = '';

updateArray($array,'New Value');

function updateArray(&$a,$v) {
    $GLOBALS[lastarray] = $a;
    $a = array($v);
}

echo "New Array:
";
print_R($array);

echo "Last Array:
";
print_R($lastarray);


Output:
1
2
3
4
5
6
7
8
9
10
New Array:
Array
(
    [0] => New Value
)
Last Array:
Array
(
    [0] => Old Value
)


Create a new paste based on this one


Comments: