Page 1 of 1

Calling a function from a function

Posted: Fri Jul 30, 2004 12:08 pm
by mshita
Hi,

How do I call a function from inside another function? Like

Code: Select all

function blabla()
{
.......
blaanother();
}

function blaanother()
{
...
}

Posted: Fri Jul 30, 2004 12:21 pm
by d3ad1ysp0rk
exactly like that?

Code: Select all

function blah1(){
$a = 7;
$b = blah2();
$c = $a+$b;
echo $c;
}

function blah2(){
return 4;
}
Prints 11.

Posted: Fri Jul 30, 2004 12:26 pm
by mshita
It worked.....it didn't work the first time I tried. I must have done something weird.

Thanks :)

Posted: Fri Jul 30, 2004 12:29 pm
by d3ad1ysp0rk
No problem. Good luck :)