TJMAudio Posted October 14, 2006 Share Posted October 14, 2006 I have a function that checks to make sure everything in the form is valid and filled out and I want to make it so if all passes, then it calls another function to create the user account... is this possible? Do I have to create a class to do this?Thanks. Link to comment https://forums.phpfreaks.com/topic/23943-is-it-possible-to-call-a-function-inside-of-another-function/ Share on other sites More sharing options...
Stooney Posted October 14, 2006 Share Posted October 14, 2006 Its possible. ex:function check(){ //checks stuff //if(all is ok){ make_account($user, $pass); }}function make_account($user, $pass){ //makes account}you can call function from function from function over and over. :D Link to comment https://forums.phpfreaks.com/topic/23943-is-it-possible-to-call-a-function-inside-of-another-function/#findComment-108826 Share on other sites More sharing options...
wildteen88 Posted October 14, 2006 Share Posted October 14, 2006 If you mean a function within a function:[code]function myfuncA() { // code for function A function myfuncB() { // code for function B }}[/code]Then yes. However you have to called function A first before using function b. Example:[code]function myfuncA() { echo "Called function A<br />"; function myfuncB() { echo "Called function B"; }}// call function a first:myfuncA();// now we can use function bmyfuncB();[/code] Link to comment https://forums.phpfreaks.com/topic/23943-is-it-possible-to-call-a-function-inside-of-another-function/#findComment-108850 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.