SlideShare a Scribd company logo
Php training in chandigarh
CBitss Technologies, SCO:23-24-25, Level 3rd, Sector 34A,
Chandigarh, , 160022 Contact : 9914641983
Php  training in chandigarh
PHP History
PHP 3
PHP 3.0 was the first version that closely resembles PHP as it exists today. Finding PHP/FI 2.0 still inefficient and lacking
features they needed to power an eCommerce application they were developing for a university project, Andi Gutmans
and Zeev Suraski of Tel Aviv, Israel, began yet another complete rewrite of the underlying parser in 1997.
PHP 4
By the winter of 1998, shortly after PHP 3.0 was officially released, Andi Gutmans and Zeev Suraski had begun working
on a rewrite of PHP's core. The design goals were to improve performance of complex applications, and improve the
modularity of PHP's code base. Such applications were made possible by PHP 3.0's new features and support for a wide
variety of third party databases and APIs, but PHP 3.0 was not designed to handle such complex applications efficiently.
PHP 5
PHP 5 was released in July 2004 after long development and several pre-releases. It is mainly driven by its core, the Zend
Engine 2.0 with a new object model and dozens of other new features.
Installation & configuration
1. Step 1: Install MySQL. Install the MySQL database server on your PC. ...
2. Step 2: Install Apache. Install the Apache web server on your PC. ...
3. Step 3: Install PHP. Now install the PHP scripting language on your PC. ...
4. Step 4: Configure Apache and PHP. ...
5. Step 5: Test your install. ...
6. Step 6: Install Git. ...
7. Step 7: Install Moodle.
PHP basic syntax
A PHP script can be placed anywhere in the
document.
A PHP script starts with <?php and ends with ?>:
<?php
// PHP code goes here
?>
PHP Date Php Variables
The PHP date() function convert a
timestamp to a more readable date
and time. The computer stores
dates and times in a format called
UNIX Timestamp, which measures
time as a number of seconds since
the beginning of the Unix epoch
(midnight Greenwich Mean Time
on January 1, 1970 i.e. January 1,
1970 00:00:00 GMT ).
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)
Strings in php
A string is a sequence of characters, like "Hello world!".
Get The Length of a String
The PHP strlen() function returns the length of a string.
The example below returns the length of the string "Hello world!":
<?php
echo strlen("Hello world!"); // outputs 12
?>
Understanding Operators in php
Operators are used to perform operations on variables and values.
PHP divides the operators in the following groups:
● Arithmetic operators
● Assignment operators
● Comparison operators
● Increment/Decrement operators
● Logical operators
● String operators
● Array operators
If…Else
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
The PHP switch Statement
Use the switch statement to select one of many blocks of code to be executed.
Syntax
switch (n) {
case label1:
code to be executed if n=label1;
break;
case label2:
code to be executed if n=label2;
break;
PHP Array : An array is a special variable, which can hold more than one value at a time.
If you have a list of items (a list of car names, for example), storing the cars in single variables
could look like this:
$cars1 = "Volvo";
$cars2 = "BMW";
$cars3 = "Toyota";
However, what if you want to loop through the cars and find a specific one? And what if you
had not 3 cars, but 300?
The solution is to create an array!
An array can hold many values under a single name, and you can access the values by referring
to an index number.
PHP Sorting Arrays
PHP - Sort Functions For Arrays
In this chapter, we will go through the following PHP array sort functions:
● sort() - sort arrays in ascending order
● rsort() - sort arrays in descending order
● asort() - sort associative arrays in ascending order, according to the value
● ksort() - sort associative arrays in ascending order, according to the key
● arsort() - sort associative arrays in descending order, according to the value
● krsort() - sort associative arrays in descending order, according to the key
While & Do while loops
Often when you write code, you want the same block of code to run over and over
again in a row. Instead of adding several almost equal code-lines in a script, we
can use loops to perform a task like this.
In PHP, we have the following looping statements:
● while - loops through a block of code as long as the specified condition is true
● do...while - loops through a block of code once, and then repeats the loop as
long as the specified condition is true
● for - loops through a block of code a specified number of times
● foreach - loops through a block of code for each element in an array
For Loops
The for loop is used when you know in advance how many times the script
should run.
Syntax
for (init counter; test counter; increment counter) {
code to be executed;
}
Functions
Besides the built-in PHP functions, we can create our own functions.
A function is a block of statements that can be used repeatedly in a
program.
A function will not execute immediately when a page loads.
A function will be executed by a call to the function.
The GET Method
The GET method sends the encoded user information appended to the page request. The page
and the encoded information are separated by the ? character.
http://www.test.com/index.htm?name1=value1&name2=value2
● The GET method produces a long string that appears in your server logs, in the browser's
Location: box.
● The GET method is restricted to send upto 1024 characters only.
● Never use GET method if you have password or other sensitive information to be sent to
the server.
● GET can't be used to send binary data, like images or word documents, to the server.
● The data sent by GET method can be accessed using QUERY_STRING environment
variable.
● The PHP provides $_GET associative array to access all the sent information using GET
method.
The POST Method
The POST method transfers information via HTTP headers. The
information is encoded as described in case of GET method and put into a
header called QUERY_STRING.
● The POST method does not have any restriction on data size to be
sent.
● The POST method can be used to send ASCII as well as binary data.
● The data sent by POST method goes through HTTP header so security
depends on HTTP protocol. By using Secure HTTP you can make sure
that your information is secure.
● The PHP provides $_POST associative array to access all the sent
information using POST method.
Contact Us
OFFICE : SCO 23-24-25, LEVEL-3,
near passport office,
Sector 34A, Chandigarh
PHONE : 9988741983, 9914641983
Visit : http://cbitss.com/php-training-in-chandigarh.html
THANK
YOU

More Related Content

ODP
OpenGurukul : Language : PHP
PDF
Programming with Python - Adv.
PDF
C++primer
PPTX
Go Programming Language (Golang)
PDF
FTD JVM Internals
PDF
RAII and ScopeGuard
ODP
PHP floating point precision
PPT
Introduction to php php++
OpenGurukul : Language : PHP
Programming with Python - Adv.
C++primer
Go Programming Language (Golang)
FTD JVM Internals
RAII and ScopeGuard
PHP floating point precision
Introduction to php php++

What's hot (20)

DOCX
php questions
PDF
PHP Reviewer
PDF
Ekon bestof rtl_delphi
PDF
First session quiz
PDF
File Handling in C Programming
PPTX
Presentation on C++ programming
PDF
Specialized Compiler for Hash Cracking
PDF
web programming UNIT VIII python by Bhavsingh Maloth
PPTX
Learn python – for beginners
PDF
Introduction to Go language
PPTX
Writing and using php streams and sockets
PDF
Python programming
PDF
Generating parsers using Ragel and Lemon
PDF
What is Python Lambda Function? Python Tutorial | Edureka
PDF
Insecure coding in C (and C++)
PPTX
Php intro by sami kz
PDF
Introduction to python programming
PPTX
Switch case and looping jam
PPTX
Switch case and looping kim
PPTX
Python introduction towards data science
php questions
PHP Reviewer
Ekon bestof rtl_delphi
First session quiz
File Handling in C Programming
Presentation on C++ programming
Specialized Compiler for Hash Cracking
web programming UNIT VIII python by Bhavsingh Maloth
Learn python – for beginners
Introduction to Go language
Writing and using php streams and sockets
Python programming
Generating parsers using Ragel and Lemon
What is Python Lambda Function? Python Tutorial | Edureka
Insecure coding in C (and C++)
Php intro by sami kz
Introduction to python programming
Switch case and looping jam
Switch case and looping kim
Python introduction towards data science
Ad

Similar to Php training in chandigarh (20)

PDF
Programming in PHP Course Material BCA 6th Semester
PPTX
Php and MySQL final year bca notes for bca.pptx
PPSX
PHP Comprehensive Overview
PDF
Materi Dasar PHP
PDF
Php tutorial(w3schools)
PDF
Php tutorialw3schools
PDF
Introduction to PHP - Basics of PHP
PPTX
Basic of PHP
PDF
Hsc IT 5. Server-Side Scripting (PHP).pdf
PPT
PHP - Introduction to PHP - Mazenet Solution
PPTX
Introduction to php
PPTX
Introduction to PHP (Hypertext Preprocessor).pptx
PPT
PHP - Web Development
PDF
Php tutorial from_beginner_to_master
PDF
Lesson-5-php BY AAFREEN SHAIKH.pdf HSC INFORMATION TECHNOLOGY CHAP 5 PHP
PDF
Chap 4 PHP.pdf
Programming in PHP Course Material BCA 6th Semester
Php and MySQL final year bca notes for bca.pptx
PHP Comprehensive Overview
Materi Dasar PHP
Php tutorial(w3schools)
Php tutorialw3schools
Introduction to PHP - Basics of PHP
Basic of PHP
Hsc IT 5. Server-Side Scripting (PHP).pdf
PHP - Introduction to PHP - Mazenet Solution
Introduction to php
Introduction to PHP (Hypertext Preprocessor).pptx
PHP - Web Development
Php tutorial from_beginner_to_master
Lesson-5-php BY AAFREEN SHAIKH.pdf HSC INFORMATION TECHNOLOGY CHAP 5 PHP
Chap 4 PHP.pdf
Ad

More from CBitss Technologies (12)

PPTX
Career opportunities in python
PPTX
Web Designing Trends 2019
PPTX
Introduction and history of tally accounting software
PPT
Ielts coaching in chandigarh english pro
PPTX
Glimpse of previous you tube events c-bitss technologies
PPTX
Industrial training in chandigarh
PPTX
Android training in chandigarh
PPTX
Php training in chandigarh
PPTX
Android training in chandigarh
PPTX
Android Training in Chandigarh
PPTX
Linux training in chandigarh
PPTX
Php training in chandigarh
Career opportunities in python
Web Designing Trends 2019
Introduction and history of tally accounting software
Ielts coaching in chandigarh english pro
Glimpse of previous you tube events c-bitss technologies
Industrial training in chandigarh
Android training in chandigarh
Php training in chandigarh
Android training in chandigarh
Android Training in Chandigarh
Linux training in chandigarh
Php training in chandigarh

Recently uploaded (20)

PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PDF
Basic Mud Logging Guide for educational purpose
PDF
Pre independence Education in Inndia.pdf
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PPTX
PPH.pptx obstetrics and gynecology in nursing
PDF
TR - Agricultural Crops Production NC III.pdf
PDF
Computing-Curriculum for Schools in Ghana
PDF
O7-L3 Supply Chain Operations - ICLT Program
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
01-Introduction-to-Information-Management.pdf
PPTX
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
PPTX
Pharma ospi slides which help in ospi learning
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
Classroom Observation Tools for Teachers
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Basic Mud Logging Guide for educational purpose
Pre independence Education in Inndia.pdf
2.FourierTransform-ShortQuestionswithAnswers.pdf
O5-L3 Freight Transport Ops (International) V1.pdf
102 student loan defaulters named and shamed – Is someone you know on the list?
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PPH.pptx obstetrics and gynecology in nursing
TR - Agricultural Crops Production NC III.pdf
Computing-Curriculum for Schools in Ghana
O7-L3 Supply Chain Operations - ICLT Program
Abdominal Access Techniques with Prof. Dr. R K Mishra
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
Microbial diseases, their pathogenesis and prophylaxis
01-Introduction-to-Information-Management.pdf
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
Pharma ospi slides which help in ospi learning
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
Classroom Observation Tools for Teachers

Php training in chandigarh

  • 1. Php training in chandigarh CBitss Technologies, SCO:23-24-25, Level 3rd, Sector 34A, Chandigarh, , 160022 Contact : 9914641983
  • 3. PHP History PHP 3 PHP 3.0 was the first version that closely resembles PHP as it exists today. Finding PHP/FI 2.0 still inefficient and lacking features they needed to power an eCommerce application they were developing for a university project, Andi Gutmans and Zeev Suraski of Tel Aviv, Israel, began yet another complete rewrite of the underlying parser in 1997. PHP 4 By the winter of 1998, shortly after PHP 3.0 was officially released, Andi Gutmans and Zeev Suraski had begun working on a rewrite of PHP's core. The design goals were to improve performance of complex applications, and improve the modularity of PHP's code base. Such applications were made possible by PHP 3.0's new features and support for a wide variety of third party databases and APIs, but PHP 3.0 was not designed to handle such complex applications efficiently. PHP 5 PHP 5 was released in July 2004 after long development and several pre-releases. It is mainly driven by its core, the Zend Engine 2.0 with a new object model and dozens of other new features.
  • 4. Installation & configuration 1. Step 1: Install MySQL. Install the MySQL database server on your PC. ... 2. Step 2: Install Apache. Install the Apache web server on your PC. ... 3. Step 3: Install PHP. Now install the PHP scripting language on your PC. ... 4. Step 4: Configure Apache and PHP. ... 5. Step 5: Test your install. ... 6. Step 6: Install Git. ... 7. Step 7: Install Moodle.
  • 5. PHP basic syntax A PHP script can be placed anywhere in the document. A PHP script starts with <?php and ends with ?>: <?php // PHP code goes here ?>
  • 6. PHP Date Php Variables The PHP date() function convert a timestamp to a more readable date and time. The computer stores dates and times in a format called UNIX Timestamp, which measures time as a number of seconds since the beginning of the Unix epoch (midnight Greenwich Mean Time on January 1, 1970 i.e. January 1, 1970 00:00:00 GMT ). 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)
  • 7. Strings in php A string is a sequence of characters, like "Hello world!". Get The Length of a String The PHP strlen() function returns the length of a string. The example below returns the length of the string "Hello world!": <?php echo strlen("Hello world!"); // outputs 12 ?>
  • 8. Understanding Operators in php Operators are used to perform operations on variables and values. PHP divides the operators in the following groups: ● Arithmetic operators ● Assignment operators ● Comparison operators ● Increment/Decrement operators ● Logical operators ● String operators ● Array operators
  • 9. If…Else 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
  • 10. The PHP switch Statement Use the switch statement to select one of many blocks of code to be executed. Syntax switch (n) { case label1: code to be executed if n=label1; break; case label2: code to be executed if n=label2; break;
  • 11. PHP Array : An array is a special variable, which can hold more than one value at a time. If you have a list of items (a list of car names, for example), storing the cars in single variables could look like this: $cars1 = "Volvo"; $cars2 = "BMW"; $cars3 = "Toyota"; However, what if you want to loop through the cars and find a specific one? And what if you had not 3 cars, but 300? The solution is to create an array! An array can hold many values under a single name, and you can access the values by referring to an index number.
  • 12. PHP Sorting Arrays PHP - Sort Functions For Arrays In this chapter, we will go through the following PHP array sort functions: ● sort() - sort arrays in ascending order ● rsort() - sort arrays in descending order ● asort() - sort associative arrays in ascending order, according to the value ● ksort() - sort associative arrays in ascending order, according to the key ● arsort() - sort associative arrays in descending order, according to the value ● krsort() - sort associative arrays in descending order, according to the key
  • 13. While & Do while loops Often when you write code, you want the same block of code to run over and over again in a row. Instead of adding several almost equal code-lines in a script, we can use loops to perform a task like this. In PHP, we have the following looping statements: ● while - loops through a block of code as long as the specified condition is true ● do...while - loops through a block of code once, and then repeats the loop as long as the specified condition is true ● for - loops through a block of code a specified number of times ● foreach - loops through a block of code for each element in an array
  • 14. For Loops The for loop is used when you know in advance how many times the script should run. Syntax for (init counter; test counter; increment counter) { code to be executed; }
  • 15. Functions Besides the built-in PHP functions, we can create our own functions. A function is a block of statements that can be used repeatedly in a program. A function will not execute immediately when a page loads. A function will be executed by a call to the function.
  • 16. The GET Method The GET method sends the encoded user information appended to the page request. The page and the encoded information are separated by the ? character. http://www.test.com/index.htm?name1=value1&name2=value2 ● The GET method produces a long string that appears in your server logs, in the browser's Location: box. ● The GET method is restricted to send upto 1024 characters only. ● Never use GET method if you have password or other sensitive information to be sent to the server. ● GET can't be used to send binary data, like images or word documents, to the server. ● The data sent by GET method can be accessed using QUERY_STRING environment variable. ● The PHP provides $_GET associative array to access all the sent information using GET method.
  • 17. The POST Method The POST method transfers information via HTTP headers. The information is encoded as described in case of GET method and put into a header called QUERY_STRING. ● The POST method does not have any restriction on data size to be sent. ● The POST method can be used to send ASCII as well as binary data. ● The data sent by POST method goes through HTTP header so security depends on HTTP protocol. By using Secure HTTP you can make sure that your information is secure. ● The PHP provides $_POST associative array to access all the sent information using POST method.
  • 18. Contact Us OFFICE : SCO 23-24-25, LEVEL-3, near passport office, Sector 34A, Chandigarh PHONE : 9988741983, 9914641983 Visit : http://cbitss.com/php-training-in-chandigarh.html