How does the PHP interpreter distinguish between PHP code and plain text when including files in PHP scripts?

When including files in PHP scripts, the PHP interpreter distinguishes between PHP code and plain text by recognizing the opening and closing PHP tags <?php and ?>. Any content within these tags is executed as PHP code, while anything outside of these tags is treated as plain text.

// Example of including a PHP file with both PHP code and plain text

// Including a file with PHP code
include &#039;file_with_php_code.php&#039;;

// Including a file with plain text
include &#039;file_with_plain_text.txt&#039;;