Re: variable in function parameter

From: Date: Mon, 28 Jul 2003 09:34:16 +0000
Subject: Re: variable in function parameter
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-157145@lists.php.net to get a copy of this message
www.php.net/variables.scope You need "global $a;" as the first line in your function. 386-DX wrote:
Hello. Let's say I have something like this: function aa($test) {
    $a = 8;
    echo $test;
} $a = 2; aa("a is ". ($a>5?"greater":"equal to or less"). " than 5".); I want this to output "a is greater than 5".. how can i modify the code so that the function parameter is evaluated inside the function?


« previous php.general (#157145) next »