note 6492 deleted from exit by ronabop

From: Date: Sun, 03 Sep 2000 10:39:42 +0000
Subject: note 6492 deleted from exit by ronabop
Groups: php.notes 
Request: Send a blank email to php-notes+get-4050@lists.php.net to get a copy of this message
Say I have a file function.php that is required by another file page.php. I want the file to act as an include file like in C++. If I use define() and defined() I can tell whether the page is up and in use. Can I use exit to keep PHP from running the rest of that page if the constant for that page is already in use? I.e the following: <PRE> <SCRIPT LANGUAGE="PHP"> if (defined("MY_PAGE_CONST","YES")) { exit(); } define("MY_PAGE_CONST","YES"); .../* Rest Of Page */ ... </SCRIPT> </PRE> What can I use to make that work in the case the a page is included more than once? (If responding by email, please cc the message to bm_witness@yahoo.com. Thank you.)

« previous php.notes (#4050) next »