Jump to content

Recommended Posts

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

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 :)
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.