FatalFanatic
August 19th, 2003, 11:21 AM
There are 2 very similar PHP scripts. The first one works properly, the second one does not.
If this works:
<?php
$x[0] = 1;
$y = 1;
function YaY($a,$b)
{
print $a[0];
print $b;
}
YaY($x,$y);
?>
Then why does this not: :(
<?php
$x[0] = 1;
$y = 1;
function YaY($a,$b)
{
global $a, $b;
print $a[0];
print $b;
}
YaY($x,$y);
?>
And how could I make it work with the same effect?
Thanks in advance.
If this works:
<?php
$x[0] = 1;
$y = 1;
function YaY($a,$b)
{
print $a[0];
print $b;
}
YaY($x,$y);
?>
Then why does this not: :(
<?php
$x[0] = 1;
$y = 1;
function YaY($a,$b)
{
global $a, $b;
print $a[0];
print $b;
}
YaY($x,$y);
?>
And how could I make it work with the same effect?
Thanks in advance.