note 102712 modified in function.define by danbrown

[email protected]
Newsgroups php.notes
Message-ID <[email protected]>
This is obvious, but easy to forget: if you include a file, the include file can only make use of constants already defined. For example:

<?php
define("VEG","cabbage");
require("another file");
define("FRUIT","apple");

// "another file":
echo VEG; // cabbage
echo FRUIT; // FRUIT
?>

--was--
This is obvious, but easy to forget: if you include a file, the include file can only make use of constants already defined. For example:

define("VEG","cabbage");
require("another file");
define("FRUIT","apple");

// "another file":
echo VEG; // cabbage
echo FRUIT; // FRUIT

http://php.net/manual/en/function.define.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.