Running PHP code

Create a file index.php containing the following code.
<!DOCTYPE html>

<html lang="en">

<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title> CSE104 </title>
</head>

<body>

<?php 
$a = "Hello";
print "This text is written by PHP! $a";
?>

</body>

</html>
To run this code, we need a server with PHP interpretor. You have 3 options:

1. Upload your file on cse104.org

This approach is however less convenient for local development as you need to re-upload your file for each modification.

2. Install PHP on MacOS/Linux

3. Install XAMPP on Windows

assets/xampp.jpg
A detailed video tutorial is available here:
You should now see the result of the PHP interpretation.
A few notes: