What is the difference between using a .php file extension and a .inc file extension in PHP?

Using a .php file extension is the standard practice for PHP files, as it allows the server to interpret and execute the PHP code within the file. On the other hand, using a .inc file extension is often used for files that contain PHP code but are intended to be included in other PHP files rather than executed directly. It is important to note that using .inc files can pose a security risk if they are placed in a publicly accessible directory, as the PHP code within them can be viewed by anyone.

// Example of including a .inc file in a PHP file using the include() function
include('myfile.inc');