In the previous section, we have seen how to set up a XAMPP server on your computer. In this section, we will show how to run PHP code in XAMPP.
 You can run PHP code in XAMPP by following the below steps.


Step1: Create PHP code. Every PHP statement ends with a semicolon(;).
<?php
echo "My first php code.";
?>

Step2: Save the created code in "C:\xampp\htdocs" with the file extension .PHP.
           Example: code1.php















Step3:Run the XAMPP server and start the Apache and MySQL.








Step4: Open any web browser and type localhost/code1.php on the search bar. Then, the output for the above PHP code(code1.php) will be shown as below.