Page 1 of 1

variable - function question

Posted: Wed Apr 14, 2004 9:07 am
by bytte
I have a function that ends with the echo of a number.
So if I call the function in my script, the visible result is a number.

I'm calling the function quite a lot and the output is everytime a different number.

No problem so far.

Now I need to do simple calculations with these outputted numbers.
How can I put them into a variable, so I can easily work with them?

Or how can I use the variable of the function in my script outside of the function?

Posted: Wed Apr 14, 2004 9:12 am
by magicrobotmonkey
$var = Function(); - if you do a return instead of an echo which is more proper anyways