note 102712 modified in function.define by danbrown

From: Date: Tue, 01 Mar 2011 21:25:04 +0000
Subject: note 102712 modified in function.define by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-177467@lists.php.net to get a copy of this message
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

« previous php.notes (#177467) next »