note 127536 added to function.require
| From: | osheros at hotmail dot com | Date: | Thu, 25 Aug 2022 22:34:08 +0000 |
| Subject: | note 127536 added to function.require | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-219475@lists.php.net to get a copy of this message | ||
When using an include file to define one or more global variables (to avoid having to redefine them
in multiple files), make sure you're referencing the same variable.
[global.php]
$app_dir = "/app/path/here";
[main.php]
include "global.php";
/* the following obviously won't work but hopefully I can save somebody else hours trying to
figure out why their global include isn't working */
echo $app_folder;
----
Server IP: 45.112.84.4
Probable Submitter: 185.85.3.175 (proxied: 50.35.184.159)
----
Manual Page -- https://php.net/manual/en/function.require.php
Edit -- https://main.php.net/note/edit/127536
Del: integrated -- https://main.php.net/note/delete/127536/integrated
Del: useless -- https://main.php.net/note/delete/127536/useless
Del: bad code -- https://main.php.net/note/delete/127536/bad+code
Del: spam -- https://main.php.net/note/delete/127536/spam
Del: non-english -- https://main.php.net/note/delete/127536/non-english
Del: in docs -- https://main.php.net/note/delete/127536/in+docs
Del: other reasons-- https://main.php.net/note/delete/127536
Reject -- https://main.php.net/note/reject/127536
Search -- https://main.php.net/manage/user-notes.php