PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
mshita
Forum Commoner
Posts: 32 Joined: Sat Jul 03, 2004 8:55 pm
Location: Portland, OR
Contact:
Post
by mshita » Fri Jul 30, 2004 12:08 pm
Hi,
How do I call a function from inside another function? Like
Code: Select all
function blabla()
{
.......
blaanother();
}
function blaanother()
{
...
}
d3ad1ysp0rk
Forum Donator
Posts: 1661 Joined: Mon Oct 20, 2003 8:31 pm
Location: Maine, USA
Post
by d3ad1ysp0rk » Fri Jul 30, 2004 12:21 pm
exactly like that?
Code: Select all
function blah1(){
$a = 7;
$b = blah2();
$c = $a+$b;
echo $c;
}
function blah2(){
return 4;
}
Prints 11.
mshita
Forum Commoner
Posts: 32 Joined: Sat Jul 03, 2004 8:55 pm
Location: Portland, OR
Contact:
Post
by mshita » Fri Jul 30, 2004 12:26 pm
It worked.....it didn't work the first time I tried. I must have done something weird.
Thanks
d3ad1ysp0rk
Forum Donator
Posts: 1661 Joined: Mon Oct 20, 2003 8:31 pm
Location: Maine, USA
Post
by d3ad1ysp0rk » Fri Jul 30, 2004 12:29 pm
No problem. Good luck