elibraryportal Logo

PHP Syntax

PHP script starts with the <?php and ends with the ?> tag.

Syntax

Example

Output:-

Simple PHP Example

Statement end with a semicolon (;)

PHP with HTML

Example

Save the example1.php

Output:-

Simple PHP Example

PHP Comments

PHP support single-line as well as multi-line comments. To write a single-line comment either start the line with either two slashes (//) or a hash symbol (#).

Example

Output:-

Simple PHP Example

PHP Case Sensitivity

Only Variable names are case-sensitive in PHP. such as variables $color, $Color and $COLOR

Example

Output:-

PHP Example CasesenSetive
Next Topic