I have this code on a page:
<p class="appTitle ">
<?php echo "$appTitle" ; ?>
</p>
But the resulting HTML is:
<p class="appTitle ">
</p>
$appTitle is a global variable which I've declared at the top of the
page in a require_once file like this:
$_GLOBALS['appTitle'] = "My App Title";
According to my debugger, $appTitle is defined with the correct value
when execution reaches that point.
I've also tried,
<?= "$appTitle" ?>
However this work fine:
<?php
$appTitle = "My app";
?>
<?= $appTitle ?>
I have a feeling the answer is something totally obvious, and I'm just
not seeing it.
Phester
<p class="appTitle ">
<?php echo "$appTitle" ; ?>
</p>
But the resulting HTML is:
<p class="appTitle ">
</p>
$appTitle is a global variable which I've declared at the top of the
page in a require_once file like this:
$_GLOBALS['appTitle'] = "My App Title";
According to my debugger, $appTitle is defined with the correct value
when execution reaches that point.
I've also tried,
<?= "$appTitle" ?>
However this work fine:
<?php
$appTitle = "My app";
?>
<?= $appTitle ?>
I have a feeling the answer is something totally obvious, and I'm just
not seeing it.
Phester
Comment