Code: Select all
<?php
$testArray = array('foo','bar','baz');
echo $testArray[0];
echo "<br /><br />";
function testTheArray() { echo "Running test: ".$testArray[0]; }
testTheArray();
?>
...but I'll post this up anyway (may help someone):
Fixed code:
Code: Select all
<?php
$testArray = array('foo','bar','baz');
echo $testArray[0];
echo "<br /><br />";
function testTheArray() { global $testArray; echo "Running test: ".$testArray[0]; }
testTheArray();
?>