<?=$a?>
Это альтернативный синтаксис для более простой вставки вывода PHP переменных в HTML контексте
Читаем внимательно документацию:
Example 1.1. Ways of escaping from HTML
copy to clipboard
1. <?php echo("if you want to serve XHTML or XML documents, do like this\n"); ?>
2. <? echo ("this is the simplest, an SGML processing instruction\n"); ?>
<?= expression ?> This is a shortcut for "<? echo expression ?>"
3. <script language="php">
echo ("some editors (like FrontPage) don't
like processing instructions");
</script>
4. <% echo ("You may optionally use ASP-style tags"); %>
<%= $variable; # This is a shortcut for "<% echo . . ." %>
The first way, <?php. . .?>, is the preferred method, as it allows the use of PHP in XML-conformant code such as XHTML.
The second way is not available always. Short tags are available only when they have been enabled. This can be done via the short_tags() function (PHP 3 only), by enabling the short_open_tag configuration setting in the PHP config file, or by compiling PHP with the --enable-short-tags option to configure. Even if it is enabled by default in php.ini-dist, use of short tags are discouraged.
The fourth way is only available if ASP-style tags have been enabled using the asp_tags configuration setting.
Собственно указанные в вопросе оба способа вывода являются так называемыми short-tags (короткими, сокращенными тегами), относятся ко второму пункту и полностью идентичны. А рекомендуется использовать способ №1.
Там же в документации читаем замечание:
Note:
Using short tags should be avoided when developing applications or libraries that are meant for redistribution, or deployment on PHP servers which are not under your control, because short tags may not be supported on the target server. For portable, redistributable code, be sure not to use short tags.
Поэтому если вы собираетесь распространять свой код, то использование коротких тегов настоятельно не рекомендуется.
--------------------------------------------------------------
Правильно заданный вопрос содержит в себе половину ответа