seen this in someone elses code i was working on and was sure what is does. creates an error anyway when i run it on wamp. im thinking its a mistake in the code. can anyone shine a light on this for me cheers!
<p><?=$last_key?></p>
<p><?=$lastSeen?></p>
unsure about syntax i havent encountered before?
Moderator: General Moderators
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
Re: unsure about syntax i havent encountered before?
Those are short tags and are the same as: <?php echo $last; ?> and <?php echo $lastSeen; ?>. I would not recommend using them simply for consistency, but it is really a style choice.
(#10850)
Re: unsure about syntax i havent encountered before?
so basically ALL its doing is echoing out the variable. i dont like the look of that myself either to be honest.
- AbraCadaver
- DevNet Master
- Posts: 2572
- Joined: Mon Feb 24, 2003 10:12 am
- Location: The Republic of Texas
- Contact:
Re: unsure about syntax i havent encountered before?
And it needs to be enabled in the server configuration in order for it to work.eoinahern wrote:so basically ALL its doing is echoing out the variable. i dont like the look of that myself either to be honest.
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
Re: unsure about syntax i havent encountered before?
Not since 5.4: it's available regardless of the short_open_tags setting.AbraCadaver wrote:And it needs to be enabled in the server configuration in order for it to work.
I, for one, like it.
Code: Select all
<?php echo $variable; ?>Code: Select all
<?=$variable?>Re: unsure about syntax i havent encountered before?
I use it all the time in my views. It's nice and succinct.