In .net we've got the following to write a variable (well, it's ToString() method) in an asp.net page:
<%= myString %>
Is there anything like this in php? (I'm tired of typing "ehco" instead of "echo");
In .net we've got the following to write a variable (well, it's ToString() method) in an asp.net page:
<%= myString %>
Is there anything like this in php? (I'm tired of typing "ehco" instead of "echo");
Provided you have short_open_tags
enabled in php.ini, you can use:
<?= $myString ?>
Debate rages about whether this is a good idea.
It is also possible to use ASP-style tags by enabling asp_tags
in php.ini, but they are not recommended (read, deprecated and I believe being removed in PHP6):
<%= $myString %>
<?= $var ?>
will do it.