Hi all, I am new to php. I saw this in some web site forum. What is it exactly means. Any one knows please let me know. Thanking you sure
It's very useful when you're dealing with php templating. It makes doing templates and printing our variables a lot easier in terms of number of characters you need to type in. It also looks cleaner in my opinion.
That syntax drives me nuts. It takes me soo much longer to work out bugs when I have HTML with PHP in it VS PHP that loads XML/HTML and saves cached pages. Especially when you start getting stuff like <?php if(true){ ?> <div>...</div> <?php } ?> Code (markup): Not to mention it screws my snippets and syntax highlighting in gedit up something fierce.
You should not use it as is not standard. Use as it's standard and would work fine on many invironments.
Why is it not standard? They should both work on any enviroment assuming short-tags are enabled, which they are by default.
If you are integrating php with html than only use it else simple echo is good; although its recommended to use <?php since only <? or <?= might not work in some environments (many Win Versions).
They are short tags+echo in php a short cut for <?php echo $something; ?> as <?=$something but in order to use them they should be enabled in the php.ini Try to avoid them and use the full syntax instead eg., <?php ?>