Posted by Shelly on 09/28/07 18:29
<kurt.krueckeberg@gmail.com> wrote in message
news:1191002991.546795.171650@57g2000hsv.googlegroups.com...
>I am trying to learn php. Php statements of the form <?=$var?> do not
> work? If I use <? echo $var; ?> instead, it works. I am using php5.
> Here is a saample
> <?php
> $var = 5;
> ?>
> var = 10;<br />
> The variable $var has a value of:
> <?=$var?><br />
> <!-- prior line gives no output -->
>
> thanks,
> Kurt
>
var = 10;
makes no sense. It should be:
$var = 10;
If you want to have it displayed in the middle of the html area, then say:
<?php echo $var; ?>
echo does that for you. You still need the dollar sign. Also, don't use
short tags. ALWAYS use <?php and not <?.
Shelly
[Back to original message]
|