+ All Categories
Home > Education > PHP Training in Ambala ! Batra Computer Centre

PHP Training in Ambala ! Batra Computer Centre

Date post: 12-Apr-2017
Category:
Upload: jatin-batra
View: 7 times
Download: 0 times
Share this document with a friend
24
PHP TRAINING IN AMBALA
Transcript
Page 1: PHP Training in Ambala ! Batra Computer Centre

PHP TRAINING IN AMBALA

Page 2: PHP Training in Ambala ! Batra Computer Centre

Introduction PHP is a server-side scripting language

designed primarily for web development but also used as a general-purpose programming language.

PHP code may be embedded into HTML or HTML5 code, or it can be used in combination with various web template systems, web content management systems and web frameworks.

Ph. No. :9729666670,4000670 Website: www.batracomputercentre.com

Page 3: PHP Training in Ambala ! Batra Computer Centre

PHP & Its Uses• PHP stands for Hypertext Preprocessor. • PHP is free and offered under an open

source license.• A majority of the websites you visit probably use

PHP.• PHP performs calculations.• PHP collects user information.• PHP interacts with MYSQL databases.• PHP and GD library create graphics.• PHP works with cookies.Ph. No. :9729666670,4000670 Website: www.batracomputercentre.com

Page 4: PHP Training in Ambala ! Batra Computer Centre

PHP Syntax• The PHP syntax and semantics are

the format (syntax) and the related meanings (semantics) of the text and symbols in the PHP programming language. They form a set of rules that define how a PHP program can be written and interpreted.

• A PHP script is executed on the server, and the plain HTML result is sent back to the browser.Ph. No. :9729666670,4000670 Website: www.batracomputercentre.com

Page 5: PHP Training in Ambala ! Batra Computer Centre

Basic PHP Syntax• A PHP script can be placed anywhere

in the document.• A PHP script starts with <?php and

ends with ?>:

Ph. No. :9729666670,4000670 Website: www.batracomputercentre.com

Page 6: PHP Training in Ambala ! Batra Computer Centre

The default file extension for PHP files is ".php".Ph. No. :9729666670,4000670 Website: www.batracomputercentre.com

Page 7: PHP Training in Ambala ! Batra Computer Centre

Comments in PHP A comment in PHP code is a line that is not

read/executed as part of the program. Its only purpose is to be read by someone who is looking at the code.

Comments can be used to:• Let others understand what you are doing• Remind yourself of what you did - Most

programmers have experienced coming back to their own work a year or two later and having to re-figure out what they did. Comments can remind you of what you were thinking when you wrote the code

Ph. No. :9729666670,4000670 Website: www.batracomputercentre.com

Page 8: PHP Training in Ambala ! Batra Computer Centre

Example:-

Ph. No. :9729666670,4000670 Website: www.batracomputercentre.com

Page 9: PHP Training in Ambala ! Batra Computer Centre

PHP Variables A variable can have a short name (like x and y) or a

more descriptive name (age, carname, total_volume). Rules for PHP variables:• A variable starts with the $ sign, followed by the

name of the variable• A variable name must start with a letter or the

underscore character• A variable name cannot start with a number• A variable name can only contain alpha-numeric

characters and underscores (A-z, 0-9, and _ )• Variable names are case-sensitive ($age and $AGE

are two different variables)Ph. No. :9729666670,4000670 Website: www.batracomputercentre.com

Page 10: PHP Training in Ambala ! Batra Computer Centre

Example:-

Ph. No. :9729666670,4000670 Website: www.batracomputercentre.com

Page 11: PHP Training in Ambala ! Batra Computer Centre

Conditional Statements

Very often when you write code, you want to perform different actions for different conditions. You can use conditional statements in your code to do this.

In PHP we have the following conditional statements:• if statement - executes some code if one condition is

true• if...else statement - executes some code if a

condition is true and another code if that condition is false

• if...elseif....else statement - executes different codes for more than two conditions

• Switch statement - selects one of many blocks of code to be executed

Ph. No. :9729666670,4000670 Website: www.batracomputercentre.com

Page 12: PHP Training in Ambala ! Batra Computer Centre

The IF statement

Ph. No. :9729666670,4000670 Website: www.batracomputercentre.com

Page 13: PHP Training in Ambala ! Batra Computer Centre

The if-else Statement

Ph. No. :9729666670,4000670 Website: www.batracomputercentre.com

Page 14: PHP Training in Ambala ! Batra Computer Centre

The if..elseif..else statement

Ph. No. :9729666670,4000670 Website: www.batracomputercentre.com

Page 15: PHP Training in Ambala ! Batra Computer Centre

Switch statement

Ph. No. :9729666670,4000670 Website: www.batracomputercentre.com

Page 16: PHP Training in Ambala ! Batra Computer Centre

Loops in php

Ph. No. :9729666670,4000670 Website: www.batracomputercentre.com

Page 17: PHP Training in Ambala ! Batra Computer Centre

While loop Tests the condition prior to executing the

series of statements at each iteration of the loop.

A long as the conditional expression evaluates to TRUE, the statement or command block that follows executes repeatedly.

Ph. No. :9729666670,4000670 Website: www.batracomputercentre.com

Page 18: PHP Training in Ambala ! Batra Computer Centre

Do…while loop

Ph. No. :9729666670,4000670 Website: www.batracomputercentre.com

Page 19: PHP Training in Ambala ! Batra Computer Centre

For loop PHP for loops execute a block of code a

specified number of times. The for loop is used when you know in

advance how many times the script should run.

Ph. No. :9729666670,4000670 Website: www.batracomputercentre.com

Page 20: PHP Training in Ambala ! Batra Computer Centre

Foreach loop• The foreach loop works only in arrays, and is

used to loop through each key/value pair in an array.

For every loop iteration, the value of the current array element is assigned to $value and the array pointer is moved by one, until it reached the last array element.

Ph. No. :9729666670,4000670 Website: www.batracomputercentre.com

Page 21: PHP Training in Ambala ! Batra Computer Centre

Php Function PHP functions are similar to other

programming languages. A function is a piece of code which takes

one more input in the form of parameter and does some processing and returns a value.

Ph. No. :9729666670,4000670 Website: www.batracomputercentre.com

Page 22: PHP Training in Ambala ! Batra Computer Centre

Ph. No. :9729666670,4000670 Website: www.batracomputercentre.com

Page 23: PHP Training in Ambala ! Batra Computer Centre

Ph. No. :9729666670,4000670 Website: www.batracomputercentre.com

CONTACT US

ADDRESS:

SCO -15, Dayal Bagh,

Near Hanuman Mandir

Ambala Cantt-13300, Haryana

Ph. No.: 9729666670, 8222066670 &0171-4000670

Email ID: [email protected]

Website: www.batracomputercentre.com

Page 24: PHP Training in Ambala ! Batra Computer Centre

Ph. No. :9729666670,4000670 Website: www.batracomputercentre.com


Recommended