Clarification needed on variable sequence
| From: | Randum Ian | Date: | Wed, 23 Apr 2003 09:32:45 +0000 |
| Subject: | Clarification needed on variable sequence | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-144975@lists.php.net to get a copy of this message | ||
Hi there,
I have a number of .inc file which all have the same HTML and layout but
with different content in. While we are installing a CMS framework on the
site updating these have become very time-consuming, time which could be
spent on other things.
I had the idea of having a small PHP section at the top with variable names
and then these variables will be outputted as HTML kind of like a simple
template but there is one problem.
Because I would be re-using the template it would show the same variable
name more than once but with different values. For example:
<?php
$boxname = "Box1";
?>
<h1><?=$boxname?></h1>
...then further down the page...
<?php
$boxname = "Box2";
?>
<h1><?=$boxname?></h1>
...and so on.
I am assuming this will work without any glitches?
Regards, Ian.