Search

PHP Syntax

  • Share this:
post-title

PHP script starts with <?php  and ends with ?> and statements end with a semicolon (;). PHP file normally contains HTML tags, and some PHP scripting code. PHP script that uses a built-in PHP function "echo" to output the text. PHP, keywords (e.g. if, else, while, echo, etc.), classes, functions, and user-defined functions are not case-sensitive.

Example

<!DOCTYPE html>
<html>
<body>

<h1>My first PHP page</h1>

<?php
echo "Hello World!";
?>

</body>
</html>

 

Yusuf Khalil

Yusuf Khalil