Re: Problem with Arrays?
| From: | Justin French | Date: | Sat, 22 Feb 2003 13:35:35 +0000 |
| Subject: | Re: Problem with Arrays? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-136620@lists.php.net to get a copy of this message | ||
on 22/02/03 11:46 PM, Patrick Teague (webdude@veslach.com) wrote:
> I ran into something interesting & the only thing I can figure out is that
> functions won't use any variables other than globals, those past to the
> function, or those created inside the function?
exactly :)
you bring the array or variable into the scope of the function
<?
$byteSize[0] = "bytes";
$byteSize[1] = "kb";
$byteSize[2] = "mb";
function getMaxSize( $maxSize )
{
global $byteSize;
echo $byteSize[0] . "<br/>\n";
echo $byteSize[1] . "<br/>\n";
echo $byteSize[2] . "<br/>\n";
}
?>
Justin French