That's because your PHP file is using ASP-style tags.
Here's the breakdown of why and what it means:
What are they?
<% ... %> are tags that PHP can be configured to recognize as delimiters for PHP code, similar to how ASP (Active Server Pages) uses them.
They function identically to <?php ... ?> or <? ... ?> (short open tags) when enabled.
The "Why": Historical Context
PHP included support for ASP-style tags (<% %>) and even <script language="php"> </script> tags to make it easier for developers coming from other environments (like classic ASP or even JavaScript in <script> tags) to transition to PHP. It offered a familiar syntax.
The Prerequisite: asp_tags Directive
For PHP to recognize these tags, the asp_tags directive in your php.ini file must be set to On.
asp_tags = On
By default, this directive is typically Off on modern PHP installations, as it's a discouraged practice.
Why They Are Discouraged (and you shouldn't use them):
Portability Issues: Your code will only run on servers where asp_tags is explicitly enabled. If you move your code to a new server, it might break because the default is Off.
Configuration Dependency: It makes your code dependent on a specific server configuration that is not standard.
Clarity and Readability:<?php is the universally accepted, explicit, and clear way to denote PHP code. It makes it immediately obvious what language is being used.
IDE/Editor Support: While most modern IDEs can handle them if you tell them, <?php provides the best and most reliable syntax highlighting, auto-completion, and linting.
Potential Conflicts: In very specific (and rare) cases, <% could conflict with other templating engines or client-side scripts that might use similar delimiters.
What you should do:
It's highly recommended to convert your code to use the standard PHP tags (<?php ... ?>).
(You can also use the short echo tag <?= ... ?> for echoing: <p>The current year is <?= date('Y'); ?>.</p>)
You can usually do a find-and-replace (<% with <?php and %> with ?>), but be careful if you have any <% or %> literally in your HTML/JS/CSS that isn't meant to be PHP code.