hadoob024 Posted March 4, 2006 Share Posted March 4, 2006 I have a question regarding the exit() function. I read the manual on this, but it didn't really answer my question. Suppose I have the following:Script1.php:[code]require 'Script2.php';blahblahblah();echo 'junk';[/code]And Script2.php:[code]function blahblahblah(){ exit;}[/code]So basically my question is, when exit() gets called from within Script2.php, does it just stop the execution of Script2.php? Or does it also stop the execution of Script1.php? Thanks! Link to comment https://forums.phpfreaks.com/topic/4050-question-about-exit-function/ Share on other sites More sharing options...
kenrbnsn Posted March 4, 2006 Share Posted March 4, 2006 The easiest wayt to find out is to try it.Using the exit() function will stop the script from running nomatter where it is used.Ken Link to comment https://forums.phpfreaks.com/topic/4050-question-about-exit-function/#findComment-14060 Share on other sites More sharing options...
hadoob024 Posted March 4, 2006 Author Share Posted March 4, 2006 cool. thanks. yeah, i should've just followed my own example. in my real script, the main script exits anyway, so i couldn't tell what was causing the script to end, just it running to completion, or the exit() being called in the included script. the closer i'm getting to this thing being done, the more re-assurance i need that something is correct. it's like i'm a 5 year old or something :) Link to comment https://forums.phpfreaks.com/topic/4050-question-about-exit-function/#findComment-14111 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.