|
Posted by Oli Filth on 09/26/06 11:11
The87Boy said the following on 26/09/2006 12:04:
> Are there somebody, who can tell me, what I'm doing wrong with this
> function:
> function hej($q, &$h) {
> if ($q == 0) {
> return true;
> $h = 'Hello';
> } else {
> return false;
> $h = 'Goodbye';
> }
> }
>
> $rt = hej(0, &$a);
> if ($rt==true) { echo 'Hej'; }
> else { echo 'Farvel'; }
> print_r($a);
> echo "<br />\n";
>
You are returning from the function before $h is set.
--
Oli
Navigation:
[Reply to this message]
|