November 2009
Beginner to intermediate
300 pages
5h 43m
English
Before we go on, a note about different forms of PHP syntax. The usual way to include a PHP "code island" in the midst of HTML code is like this:
<?php echo $somevariable ?>
However, CI also supports a shorter version:
<?=$somevariable?>
In this case, the external brackets delimiting the code island have lost the letters php (they are just <? ?>) and echo ( replaced by =). You can also use shorter syntax for if, for, foreach, and while loops.
It is preferable to stick to the standard format and it is also recommended in the CodeIgniter style guide. If you use the short format, note that some servers won't interpret the abbreviated format correctly. If you still wish to use the short ...
Read now
Unlock full access