?
Solved

CodeIgniter PHP alternative syntax

Posted on 2009-04-01
3
Medium Priority
?
373 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 18

Accepted Solution

by:
Hube02 earned 200 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
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.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

770 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