PHP Syntax

PHP Syntax

Basic PHP Syntax

PHP is server-side scripting language so PHP scripts are executed on the server. A PHP script can be placed anywhere in the document.
A PHP code starts with < ?php and ends with the ? >. PHP statements end with a semicolon (;).
Example


Comments in PHP

A comment is a simply text that is ignored by the PHP engine. The purpose of comments is to make the code more understandable. It heps developers for edit the code in future. There are many types of php comments.

Example