How did I create a PHP website

Create PHP pages

The PHP code with the instruction echo 'Hello World'; inserted, which ensures that the text is output at the appropriate point. You could get the idea now and ask why you need a PHP command to just output Hello World. You could also write everything in HTML.

In this example we only test whether the PHP page works at all. You could also get the statement echo use with certain conditions. For example, you could write something (translated in our language) like: If the time is between 6:00 and 20:00, write "Good day", otherwise write "Good evening". For such things the instruction becomes echo used very often.

If the text Hello World was not displayed on the screen, you should first check carefully whether the code was written correctly and the file extension .php is. If all of this applies, you should check whether PHP files are actually being passed from the web server to the PHP interpreter or whether a PHP interpreter is available. If you have storage space with a web host, you should contact the web host and ask whether PHP is switched on. If it is switched on, the web server may be set to a different PHP extension, e.g. php4 or php5. In this case you should change the file extension accordingly.