spires Posted August 14, 2009 Share Posted August 14, 2009 Hi I have a function inside on one include file. I also have another function inside of another include file. What I need to be able to do is call one of the functions inside the other function. Can this be done? Here's my code for the main function which is trying to call other function into it: Calling functions: landline_anynetwork_mins() - landline_anynetwork_price() <?php function myFunction(){ include("Library/deal_variables.php"); echo' <table width="165" height="163" cellpadding="0" cellspacing="0" border="0"> <tr> <td align="center" valign="top" background="GFX/Page_Business_mobiles/Column_Call_Action/Latest_offers.jpg"> <table width="145" height="158" border="0" cellpadding="0" cellspacing="0"> <tr> <td height="31" colspan="3" align="left"><a href="latest_offers_open.php" class="link">Our Latest Offers</a> </td> </tr> <tr> <td width="43" height="36" align="left" valign="top"></td> <td width="15" align="center" valign="top"><img src="GFX/Wrapper_Business_Mobiles/Call_arrow.jpg" alt="business mobiles for business people" width="5" height="11" /></td> <td width="87" align="left" valign="top"><a href="deal_landline_anynetwork.php" class="prodNavi">'.landline_anynetwork_mins().' mins for £'.landline_anynetwork_price().'</a></td> </tr> <tr> </table> </td> </tr> </table>'; } ?> As you can see here, it outputs the results above the table, not in the position that I want them. http://www.businessmobiles.com/test2.php Any help would be great. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/170247-calling-functions-inside-of-functions-help/ Share on other sites More sharing options...
alexdemers Posted August 14, 2009 Share Posted August 14, 2009 Try moving your include outside of myFunction() Quote Link to comment https://forums.phpfreaks.com/topic/170247-calling-functions-inside-of-functions-help/#findComment-898050 Share on other sites More sharing options...
wildteen88 Posted August 14, 2009 Share Posted August 14, 2009 I guess in your landline_anynetwork_mins() and landline_anynetwork_price() functions you're using echo? You should instead use return. Quote Link to comment https://forums.phpfreaks.com/topic/170247-calling-functions-inside-of-functions-help/#findComment-898055 Share on other sites More sharing options...
spires Posted August 14, 2009 Author Share Posted August 14, 2009 I've tried that, but it still the same. Quote Link to comment https://forums.phpfreaks.com/topic/170247-calling-functions-inside-of-functions-help/#findComment-898060 Share on other sites More sharing options...
spires Posted August 14, 2009 Author Share Posted August 14, 2009 ok wildTeen88, I shall give that a go. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/170247-calling-functions-inside-of-functions-help/#findComment-898062 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.