What is PHP?
Your PHP code gets executed on the server. After the execution, it sends the HTML back to the client’s browser. So, if I ever run
<?php echo date(“Y”); ?>
to get the current year, when I view the source, all I see is HTML.
So, if we need to hide how our site operates in the backend, we use a
How to run a PHP file?
To run a PHP you need to have local PHP server setup.
The easy way to do so is to install XAMPP or WAMP/LAMP/MAMP.
NOTE: WAMP stands for Windows, Apache, MySQL, PHP
L in LAMP stands for Linux
M in MAMP stands for MAC
XAMPP is available on all platforms
You can just Google and install one of these for your platform. The installation is as easy as next, next, finish. Although, I’ll provide the installation guide for XAMPP here.
Alternately, to test things out, you may use online tools like PHPFiddle.
How can I learn PHP?
You can refer to