Solved

CodeIgniter PHP alternative syntax

Posted on 2009-04-01
3
362 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone 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

Suggested Solutions

These days socially coordinated efforts have turned into a critical requirement for enterprises.
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
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 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 …

829 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