Does a standalone php file (e.g file1.php) require <?php ?> Tags? | Sololearn: Learn to code for FREE!

-1

Does a standalone php file (e.g file1.php) require <?php ?> Tags?

This is about when creating separate php files. Not directly into the page. Do they require <?php ?> Tags.

php

2/15/2021 1:57:26 PM

Mousin Ahanger

1 Answer

New Answer

+1

I didn't get what you mean by standalone PHP file. As I understand it, PHP processor distinct PHP code from other code possibly in same page by looking for the PHP code marker tags. So I think it is necessary despite of whether the code was embedded in HTML, or written as mere PHP code.