Solved

CodeIgniter PHP alternative syntax

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Both Easy and Powerful How easy is PHP? http://lmgtfy.com?q=how+easy+is+php (http://lmgtfy.com?q=how+easy+is+php)  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
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 …

760 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now