Re: [PHP] variable in function parameter

2003-07-29 Thread 386-DX
Yes. I simplified the example for clearance but what I really want is to send a string as a parameter which includes variable names to be processed inside the function. eval() works fine, but I'm sure there was another way. Curt Zirzow [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]

[PHP] variable in function parameter

2003-07-28 Thread 386-DX
Hello. Let's say I have something like this: function aa($test) { $a = 8; echo $test; } $a = 2; aa(a is . ($a5?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?

Re: [PHP] variable in function parameter

2003-07-28 Thread Marek Kilimajer
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 . ($a5?greater:equal to or less). than 5.); I want this to output a is greater than

Re: [PHP] variable in function parameter

2003-07-28 Thread Curt Zirzow
* Thus wrote 386-DX ([EMAIL PROTECTED]): Hello. Let's say I have something like this: function aa($test) { $a = 8; echo $test; } $a = 2; aa(a is . ($a5?greater:equal to or less). than 5.); http://php.net/eval Curt -- I used to think I was indecisive, but now I'm not so

Re: [PHP] variable in function parameter

2003-07-28 Thread CPT John W. Holmes
* Thus wrote 386-DX ([EMAIL PROTECTED]): Hello. Let's say I have something like this: function aa($test) { $a = 8; echo $test; } $a = 2; aa(a is . ($a5?greater:equal to or less). than 5.); http://php.net/eval No... you need to make $a global within the function for

Re: [PHP] variable in function parameter

2003-07-28 Thread Curt Zirzow
* Thus wrote CPT John W. Holmes ([EMAIL PROTECTED]): * Thus wrote 386-DX ([EMAIL PROTECTED]): Hello. Let's say I have something like this: function aa($test) { $a = 8; echo $test; } $a = 2; aa(a is . ($a5?greater:equal to or less). than 5.);