PHP (Hypertext Preprocessor) is a server-side scripting language designed for web development. Below is a simple example to help you understand the basic syntax and structure of PHP code.
Here’s a basic PHP script that outputs "Hello, AIT!" on the page.
<?php
echo "Hello, AIT!";
?>
Hello, AIT!
In PHP, variables are defined with a dollar sign ($) followed by the name of the variable. Below is an example of using variables in PHP.
<?php
$greeting = "Hello";
$name = "Alice";
echo $greeting . ", " . $name . "!";
?>
Hello, Alice!
PHP variables are case-sensitive, and they must start with a letter or underscore.