rockinaway Posted September 12, 2011 Share Posted September 12, 2011 Currently, in my files, I echo content through either a function called error() or a funtion called info(). Each function has 3 require statements for the header, body and footer files and that is all that is contained in the function. What I want to do is, if error() is called, is kind of leave the script and exit it. Surprisingly I have used exit; at the end of the functions to stop any more of the script being executed. Is this the best way of doing it? Quote Link to comment https://forums.phpfreaks.com/topic/246987-change-page-content/ Share on other sites More sharing options...
cunoodle2 Posted September 12, 2011 Share Posted September 12, 2011 I would think so. Was there a reason why you did NOT think using exit would be a good idea? Quote Link to comment https://forums.phpfreaks.com/topic/246987-change-page-content/#findComment-1268459 Share on other sites More sharing options...
rockinaway Posted September 12, 2011 Author Share Posted September 12, 2011 I thought maybe it was a poor way of dealing with this in functions. I've been known to think of poor code.. which I have learnt from haha Quote Link to comment https://forums.phpfreaks.com/topic/246987-change-page-content/#findComment-1268460 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.