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 Bruno Barros on 09/29/07 20:33

On 29 Sep, 19:48, Jerry Stuckle <jstuck...@attglobal.net> wrote:
> Bruno Barros wrote:
> >> And I've heard just the opposite - that they may be removed in PHP 6.
>
> > That's just what I read. And I am not for short tags. Although they
> > might sound appetizing, they reduce the compatibility with other
> > servers (on which my applications might be used on), and I don't want
> > that.
>
> >> Encouraging good coding practices IS part of what we should be doing, as
> >> is letting people know what kinds of problems their poor practices can
> >> cause.
> >> It would have dropped quickly if we didn't have a noob who finally
> >> admitted he's too lazy to type <?php once on a page.
>
> > Yes I know but somewhere in the middle of this topic he said he was
> > hired to code this way so he couldn't use the other way. And I, for
> > instance, on Zend Studio, when I write <? it puts <?php automatically.
>
> Actually, no, the original op was not hired to program this way. In
> fact, he is new to PHP, and was wondering why <?=$var;?> doesn't work.
>
> The only one promoting short tags here is Jeremy, and even he didn't say
> he was hired to code this way.
>
> It's ok if he does it - he's the only one who will be hurting when he
> upgrades and suddenly all of his scripts stop working. But he shouldn't
> be promoting bad coding practices on others, especially newbies who
> don't know any better.
>
> --
> ==================
> Remove the "x" from my email address
> Jerry Stuckle
> JDS Computer Training Corp.
> jstuck...@attglobal.net
> ==================

Yes, you are right. Jeremy said this:

> Clearly, if a customer or superior wants code a certain way, you are
> obligated to conform. This goes for any style rules a company may impose.

I have mistaken. And the guy who just wanted some help has seen
himself not going anywhere thanks to you guys.

> <?php $var = 5; ?>
> <!-- other stuff -->
> <?php=$var?><br />
>
> It doesn't. Looks like I need to change all occurances of <?=$some_var?

<?php $var = 5; ?>
<!-- other stuff -->
<?php echo $var; ?>

Yes, you do have to change, if your short tags are disabled. :S

 

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

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