Skip echo just let me see my variable

In .net, we have the following to write a variable (well, this is the ToString () method) on an asp.net page:

<%= myString %>

Is there anything similar in php? (I'm tired of typing "ehco" instead of "echo");

+3
source share
3 answers

If you included short_open_tagsin php.ini you can use:

<?= $myString ?>

The discussion is uncomfortable about the good idea of ​​a good idea .

You can also use ASP-style tags by including them asp_tagsin php.ini, but they are not recommended (they are considered outdated and I believe that they were removed in PHP6 ):

<%= $myString %>
+6

<?= $var ?> .

+3

<?= $myString ?> (, PHP )

+1

Source: https://habr.com/ru/post/1775906/


All Articles