note 50395 deleted from language.types.array by nlopess
| From: | nlopess@php.net | Date: | Sun, 27 Feb 2005 10:49:32 +0000 |
| Subject: | note 50395 deleted from language.types.array by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-85626@lists.php.net to get a copy of this message | ||
Note Submitter: Paul
----
GLOBAL ARRAY
<?
$GLOBALS['arr']=array(1,2,3,4,5);
function test(){
echo $GLOBALS['arr'][3];
}
test();
?>
GLOBAL ARRAY
<?
$arr=array(1,2,3,4,5);
function test(){
echo $GLOBALS['arr'][3];
}
test();
?>
NOT GLOBAL BUT WILL WORK
<?
function test(){
$arr=array(1,2,3,4,5);
print $arr[3];
}
test();
?>
THIS WILL NOT
<?
$l=array(1,2,3,4,5);
function test(){
print $arr[3];
}
test();
?>