---
title: PHP Syntax
---
# Basic PHP Syntax
### Start
All PHP files are saved by the extension ` .php `. PHP scripts can be added anywhere in the document. A PHP script starts with ` `.
` `
### Print
To print any statement in PHP we use `echo` command.
#### Code sample
```php
My first PHP page
```
##### NOTE: PHP statements ends with semicolon `;`
### Declaring Variables
We declare variables in PHP by adding dollar `$` sign before them.
```php
```
### Comments in PHP
To write a single line comment in PHP we put hashtag `#` or by putting `//` before the comment.
```php
```
To write a multiple line comment we start the comment with `/*` and end with `*/`.
```php
```
We can also comment out some parts of the code line.
#### Code Sample
```php
```
You can see more about this on [PHP Manual](http://php.net/manual/en/)