3 PHP Syntax
3 PHP Syntax
PHP Syntax
The PHP syntax is based on C,
Java, and Perl, so if you've used
any of those languages PHP will
look familiar to you.
<html>
<head>
<title>PHP Syntax Example</title>
</head>
<body>
<?php
echo "PHP is easy!";
?>
</body>
</html>
Semi-Colons
https://www.quackit.com/php/tutorial/php_syntax.cfm 2/5
1/21/24, 8:23 PM PHP Syntax
Comments
Example
<?php
/*
This comment is so
long that it spans
multiple lines.
https://www.quackit.com/php/tutorial/php_syntax.cfm 3/5
1/21/24, 8:23 PM PHP Syntax
*/
?>
https://www.quackit.com/php/tutorial/php_syntax.cfm 4/5
1/21/24, 8:23 PM PHP Syntax
https://www.quackit.com/php/tutorial/php_syntax.cfm 5/5