note 120850 deleted from function.define by peehaa
| From: | peehaa@php.net | Date: | Wed, 22 Mar 2017 08:20:28 +0000 |
| Subject: | note 120850 deleted from function.define by peehaa | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-208942@lists.php.net to get a copy of this message | ||
Note Submitter: lvstross at gmail dot com
----
In using define() to dynamically add a page title onto an included header file, The define() must
come before the actual include of the header file or else it will render an error.
<?php
define('TITLE', 'page_name');
include 'header.php';
?>
will successfully echo the page name.
<?php
include 'header.php';
define('TITLE', 'page_name');
?>
will fire an error in the title bar.