You are here: Re: newbie question: <?=$variable?> yields no output « PHP Programming Language « IT news, forums, messages
Re: newbie question: <?=$variable?> yields no output

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация