note 50395 added to language.types.array
| From: | Paul at osu1 dot php dot net | Date: | Sun, 27 Feb 2005 01:44:48 +0000 |
| Subject: | note 50395 added to language.types.array | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-85617@lists.php.net to get a copy of this message | ||
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();
?>
----
Manual Page -- http://www.php.net/manual/en/language.types.array.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+50395
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+50395&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+50395&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+50395&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+50395&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+50395&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+50395&report=yes
Search -- http://master.php.net/manage/user-notes.php