PHP is a server-side programming language that is used to develop web pages mainly.
PHP stands for preprocessor hypertext and developed by Rasmus Lerdorf in 1994.
The current stable release of PHP is 7.4 and the preview release is 8.0.0.
If you are using a window machine, you can install XAMPP that is the most popular PHP development environment, XAMPP is completely free and easy to install Apache distribution containing MariaDB, PHP, Perl.
After successfully download and install XAMPP on your computer, make sure you have two software also.
After all this stuff you can start to write PHP programs.
When you are writing PHP code make sure to save the file with extension .php and save file at where your XAMPP installed.
mainly it is installed at C: drive with a folder XAMPP.
You have to save files at C:\xampp\htdocs.
Where <?php is start of PHP, and ?> end of PHP
echo "Hello, welcome to PHP";
$ is used in front of the variable to declare a variable.
$country="USA"; // String variable
$age=20; // integer variable
$salary=23000.78; // float variable
$areYouHungry=false; // boolean variable
echo "Country: $country";
echo "Age: $age";
echo "Salary: $salary";
echo "are you hungry: $areYouHungry";
In PHP comments can be written in two ways.
// this is a single-line comment, python interpreter will ignore this line
echo "sum of two number is $z";