Improved Code For Launching
The code we got is too big. Besides, if you are studying on my PHP courses and will send the solution of each task with this extra code, it will be not very convenient for me to check it.
Let's improve it. To do this, let's make
two files. Let the first file be index.php
and it is the one you will run in the browser:
<meta charset="utf-8">
<?php
error_reporting(E_ALL);
ini_set('display_errors', 'on');
mb_internal_encoding('UTF-8');
include 'code.php';
?>
Pay attention to the include command,
written in the first file. This command will
automatically connect the code of the second file
to the first one. And all the commands of the first file will automatically
apply to the connected code of the second file.
And the second file will be called code.php.
In it, you will simply write PHP code, and it is
this file that you will send for verification:
<?php
echo 'test';
?>
Further in the Book, in all code examples, I will omit extra commands for simplicity.