Solved

CodeIgniter PHP alternative syntax

Posted on 2009-04-01
3
363 Views
Last Modified: 2012-05-06
Experts:

I'm new to CodeIgniter.  I see code like <?=$Hello_World?> replaces the echo function in a project I'm working on.  My question is,  is this syntax an extension of PHP that I can find on php.net or it's specific to CodeIgniter?  Who translates it to native PHP code before PHP process the source file?
0
Comment
Question by:LogicInnovations
  • 2
3 Comments
 
LVL 18

Accepted Solution

by:
Hube02 earned 50 total points
ID: 24045302
That is a shorthand form for <?php echo $Hello_World ?> and works the same.

It is part of PHP but I believe that it requires the setting in php.ini

short_open_tag = On

0
 

Author Closing Comment

by:LogicInnovations
ID: 31565585
Thanks!
0
 
LVL 18

Expert Comment

by:Hube02
ID: 24045473
This is not part of the answer, but my opinion, and you know what they say about opinions....

At any rate, I believe that you should avoid using short tags. They are not recommended and a php script that is written with short tags will not run on a server where they are disabled. What happens if this happens is that all of you code is output and visible to all. Not all hosts will turn short tags on.

Also, starting in PHP 6 short tags will be eliminated, or that is what I've read. So, everyone needs to get out of the habit of using short tags anyway.

Your best bet is to continue to use what you have always used <?php echo... rather than <?=...
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question