Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Syntax Overview: Etl Labs PVT LTD - PHP

Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

Syntax Overview

ETL LABS PVT LTD – PHP 18


Basic Syntax

PHP basic syntax is nothing it just how to start


writing PHP script. Basically, it gives the basic
structure of PHP. There are three methods to
start writing PHP scripts.

1
The basic syntax of PHP starts with <?php and
ends with ?>.

And also used short tag starts with <? and ends
with ?>.

It's also a valid syntax '< script language="php"


and ends with </script>.

ETL LABS PVT LTD – PHP 19


PHP Semicolon
2 The semicolon (;) signifies the end of a PHP
statement. There should be a semicolon after
each line.

ETL LABS PVT LTD – PHP 20


Comment in PHP

Single Line Comment


Single line comment has two types

Using "#"
Using "//―
3
Comment Syntax

// this is comment line

# this is comment line

ETL LABS PVT LTD – PHP 21


Multiple Line Comment

Comment Syntax
4
/* this is a multiple line comment.
It will not execute.
*/

ETL LABS PVT LTD – PHP 22


Case Sensitivity in PHP

PHP functions, classes, core language


keywords are case-insensitive. That means
you can write classes, functions and keyword
in any case.
5

For example, you can write echo construct in


different ways like Echo, ECHO, echo or you
can write date function like Date, DaTe, date.

ETL LABS PVT LTD – PHP 23


Case Sensitive Variable
6 PHP variables are case sensitive so you
cannot use $NAME as the place of $name.

ETL LABS PVT LTD – PHP 24


White Space
White space between lines ignored by the
7
PHP that means it's fine to leave several new
lines.

ETL LABS PVT LTD – PHP 25


White Space in Variable
8 In case of variable you cannot leave blank
(white space).

ETL LABS PVT LTD – PHP 26

You might also like