ryy705 Posted September 7, 2009 Share Posted September 7, 2009 Hello, When create a function called doA() inside of a.php and call it inside of a.php it works just fine. But if I include the file in b.php and call it inside doB() it does not work. Could some kindly explain the rules regarding the scope of a function? Thank you in advance. Link to comment https://forums.phpfreaks.com/topic/173376-solved-function-scope/ Share on other sites More sharing options...
corbin Posted September 7, 2009 Share Posted September 7, 2009 It should work fine. Can we see example code? Link to comment https://forums.phpfreaks.com/topic/173376-solved-function-scope/#findComment-913953 Share on other sites More sharing options...
ryy705 Posted September 7, 2009 Author Share Posted September 7, 2009 Thank you. You are right. It should work fine. The function was getting called before the necessary file was included. Link to comment https://forums.phpfreaks.com/topic/173376-solved-function-scope/#findComment-914214 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.