Quote:
Originally Posted by blackbeltben
Can someone please explain the temp. thing. Im trying to learn. what is temp?
|
Probably should of created a thread to ask this question but here's an example.
PHP Code:
function onCreated() {
temp.a = 1;
example();
echo(temp.a); // echos "1"
}
function example() {
temp.a = 2;
echo(temp.a); // echos "2"
}
Basically the value stays 'local' to the function it's in, and when the function is completed the value is discarded because it is no longer needed.
Placing the temp. prefix on your variable designates it as temporary. But that's the basic gist of it.