SlideShare a Scribd company logo
Introduction to PhP
Ajay Khatri
Senior Assistant Professor
Acropolis Institute of Technology & Research
www.ajaykhatri.in
https://play.google.com/store/apps/details?id=learn.apps.phpprogramming
PHP stands for
PHP => PHP: Hypertext Preprocessor.
This confuses many people because the first word of
the acronym is the acronym. This type of acronym is
called a recursive acronym.
its original name Personal Home Page
What is PHP?
Loosely typed scripting language
Executed on the server
Commonly used to build web applications
Who uses PHP?
Yahoo!
Facebook
20+ million other domain names
Brief History
Personal Home Page /
Forms Interpreter
Created by Rasmus Lerdorf
PHP/FI 1.0 released in 1995
PHP/FI 2.0 released in 1997
PHP: Hypertext
Preprocessor
Created by Andi Gutmans and Zeev Suraski
PHP 3.0 released in 1998
PHP 4.4 released in 2005
PHP 5
New object model
PHP 5.0 released in 2004
PHP 5.3 released in 2009
Syntax
Hello World
<?php
// hello.php
echo 'Hello, VT Code Camp.';
?>
Variable Assignment
<?php
$hello = 'Hello, VT Code Camp.';
echo $hello;
One Line Comments
<?php
// A one line comment
# Another one line comment
Multi-Line Comments
<?php
/*
A multi-line comment
*/
DocBlock Comments
<?php
/**
* This function does nothing
*
* @param string $bar
* @return void
*/
function foo($bar) {}
Primitive Data Types
<?php
$isPhpProgrammer = true; // boolean
$howOldIsPhp = 15; // integer
$pi = 3.14; // float
$event = 'VT Code Camp'; // string
A string can hold letters, numbers, and special
characters and it can be as large as up to 2GB
(2147483647 bytes maximum)
Conditionals
If
<?php
if (true) {
echo 'Yes';
}
If-Then-Else
<?php
if (false) {
echo 'No';
} else {
echo 'Yes';
}
If-Then-Else-If
<?php
if (false) {
echo 'No';
} elseif (false) {
echo 'No';
} else {
echo 'Yes';
}
Switch
<?php
switch ('PHP') {
case 'Ruby':
echo 'No';
break;
case 'PHP':
echo 'Yes';
break;
}
Operators
Arithmetic
<?php
$a = 10;
$b = $a + 1; // 11
$c = $a - 1; // 9
$d = $a * 5; // 50
$e = $a / 2; // 5
$f = $a % 3; // 1
String Concatenation
<?php
$myString = 'foo' . 'bar'; // foobar
$myString .= 'baz'; // foobarbaz
Comparison
Equivalence
<?php
if (2 == 3) { echo 'No'; }
if (3 == '3') { echo 'Yes'; }
if (2 != 3) { echo 'Yes'; }
Identity
<?php
if (3 === '3') { echo 'No'; }
if (3 === 3) { echo 'Yes'; }
if (3 !== 4) { echo 'Yes'; }
Logical Operators
<?php
// NOT
if (!true) { echo 'No'; }
// AND
if (true && false) { echo 'No'; }
// OR
if (true || false) { echo 'No'; }
Strings & Interpolation
Literal Single Quotes
<?php
$x = 2;
echo 'I ate $x cookies.';
// I ate $x cookies.
Double Quotes
<?php
$x = 2;
echo "I ate $x cookies.";
// I ate 2 cookies.
Literal Double Quotes
<?php
$x = 2;
echo "I ate $x cookies.";
// I ate $x cookies.
Curly Brace
Double Quotes
<?php
$x = 2;
echo "I ate {$x} cookies.";
// I ate 2 cookies.
Constants
Defining
<?php
define('HELLO', 'Hello, Code Camp');
echo HELLO; // Hello, Code Camp
As of PHP 5.3
<?php
const HELLO = 'Hello, Code Camp';
echo HELLO; // Hello, Code Camp
Arrays
Automatic Indexing
<?php
$foo[] = 'bar'; // [0] => bar
$foo[] = 'baz'; // [1] => baz
Explicit Indexing
<?php
$foo[0] = 'bar'; // [0] => bar
$foo[1] = 'baz'; // [1] => baz
Array Construct with
Automatic Indexing
<?php
$foo = array(
'bar', // [0] => bar
'baz', // [1] => baz
);
Array Construct with
Explicit Indexing
<?php
$foo = array(
0 => 'bar', // [0] => bar
1 => 'baz', // [1] => baz
);
Array Construct with
Arbitrary Indexing
<?php
$foo = array(
1 => 'bar', // [1] => bar
2 => 'baz', // [2] => baz
);
Associative Array
Explicit Indexing
<?php
$foo['a'] = 'bar'; // [a] => bar
$foo['b'] = 'baz'; // [b] => baz
Associative Array
Array Construct
<?php
$foo = array(
'a' => 'bar', // [a] => bar
'b' => 'baz', // [b] => baz
);
http://ajaykhatri.inhttp://ajaykhatri.in
Reading, Writing, and
Appending Arrays
Arrays
http://ajaykhatri.inhttp://ajaykhatri.in
Associate values to keys
Keys can be integers (enumerative arrays) or
strings (associative arrays)
Values can be primitive types, objects, or
other arrays (multidimensional arrays)
Arrays
http://ajaykhatri.inhttp://ajaykhatri.in
<?php
$post = array(
'id' => 1234,
'title' => 'Intermediate PHP',
'updated' => new DateTime(
'2010-12-16T18:00:00-05:00'
),
'draft' => false,
'priority' => 0.8,
'categories' => array('PHP', 'BTV')
);
http://ajaykhatri.inhttp://ajaykhatri.in
<?php
$post = array(
'id' => 1234,
'title' => 'Intermediate PHP',
// …
);
echo $post['title']; // Intermediate PHP
http://ajaykhatri.inhttp://ajaykhatri.in
<?php
$post = array(
'id' => 1234,
'title' => 'Intermediate PHP',
// …
);
$post['title'] = 'PHP 201';
http://ajaykhatri.inhttp://ajaykhatri.in
<?php
$post = array(
'id' => 1234,
'title' => 'Intermediate PHP',
'updated' => new DateTime(
'2010-12-16T18:00:00-05:00'
),
'draft' => false,
'priority' => 0.8,
'categories' => array('PHP', 'BTV')
);
$post['summary'] = 'Arrays, functions, and
objects';
http://ajaykhatri.inhttp://ajaykhatri.in
<?php
$post = array(
// …
'categories' => array('PHP', 'BTV')
);
$post['categories'][] = 'Programming';
print_r($post['categories']);
/*
Array
(
[0] => PHP
[1] => BTV
[2] => Programming
)
*/
http://ajaykhatri.inhttp://ajaykhatri.in
<?php
$post = array(
// …
'categories' => array('PHP', 'BTV')
);
$post['categories'][1] = 'Burlington';
print_r($post['categories']);
/*
Array
(
[0] => PHP
[1] => Burlington
)
*/
Iterators
While
<?php
$x = 0;
while ($x < 5) {
echo '.';
$x++;
}
For
<?php
for ($x = 0; $x < 5; $x++) {
echo '.';
}
Foreach
<?php
$x = array(0, 1, 2, 3, 4);
foreach ($x as $y) {
echo $y;
}
Foreach Key/Value Pairs
<?php
$talks = array(
'php' => 'Intro to PHP',
'ruby' => 'Intro to Ruby',
);
foreach ($talks as $id => $name) {
echo "$name is talk ID $id.";
echo PHP_EOL;
}
http://ajaykhatri.inhttp://ajaykhatri.in
Array Key Exists,
In Array, and Array Keys
http://ajaykhatri.inhttp://ajaykhatri.in
<?php
$post = array(
'id' => 1234,
// …
'categories' => array('PHP', 'BTV')
);
if (array_key_exists('categories', $post))
{
echo implode(', ', $post['categories']);
} else {
echo 'Uncategorized';
}
http://ajaykhatri.inhttp://ajaykhatri.in
<?php
$post = array(
// …
'categories' => array('PHP', 'BTV')
);
if (in_array('PHP', $post['categories'])) {
echo 'PHP: Hypertext Preprocessor';
}
http://ajaykhatri.inhttp://ajaykhatri.in
<?php
$posts = array(
1233 => array(/* … */),
1234 => array(/* … */),
);
print_r(array_keys($posts));
/*
Array
(
[0] => 1233
[1] => 1234
)
*/
http://ajaykhatri.inhttp://ajaykhatri.in
Sorting Arrays
http://ajaykhatri.inhttp://ajaykhatri.in
<?php
$post = array(
// …
'categories' => array('PHP', 'BTV')
);
sort($post['categories']);
print_r($post['categories']);
/*
Array
(
[0] => BTV
[1] => PHP
)
*/
http://ajaykhatri.inhttp://ajaykhatri.in
Sorting Arrays
sort() - ascending order
rsort() - descending order
asort() - according to the value
ksort() - according to the key
arsort() - descending order, according
to the value
krsort() - descending order, according
to the key
http://ajaykhatri.inhttp://ajaykhatri.in
Array Push and
Array Pop (stack)
http://ajaykhatri.inhttp://ajaykhatri.in
<?php
$post = array(
// …
'categories' => array('PHP')
);
array_push($post['categories'], 'BTV');
echo array_pop($post['categories']);
// BTV
print_r($post['categories']);
/*
Array
(
[0] => PHP
)
*/
http://ajaykhatri.inhttp://ajaykhatri.in
Array Unshift and
Array Pop (queue)
http://ajaykhatri.inhttp://ajaykhatri.in
<?php
$post = array(
// …
'categories' => array('BTV')
);
array_unshift($post['categories'], 'PHP');
print_r($post['categories']);
/*
Array
(
[0] => PHP
[1] => BTV
)
*/
echo array_pop($post['categories']);
// BTV
http://ajaykhatri.inhttp://ajaykhatri.in
Iterating Over Arrays
http://ajaykhatri.inhttp://ajaykhatri.in
<?php
$post = array(
// …
'categories' => array('PHP', 'BTV')
);
foreach ($post['categories'] as $v) {
echo $v . PHP_EOL;
}
/*
PHP
BTV
*/
http://ajaykhatri.inhttp://ajaykhatri.in
<?php
$post = array(
// …
'categories' => array('PHP', 'BTV')
);
foreach ($post['categories'] as $k => $v) {
echo $k . ': ' . $v . PHP_EOL;
}
/*
0: PHP
1: BTV
*/
http://ajaykhatri.inhttp://ajaykhatri.in
<?php
$post = array(
'id' => 1234,
'title' => 'Intermediate PHP',
// …
);
foreach ($post as $k => $v) {
echo $k . ': ' . $v . PHP_EOL;
}
/*
id: 1234
title: Intermediate PHP
…
*/
http://ajaykhatri.inhttp://ajaykhatri.in
Implode and Explode
http://ajaykhatri.inhttp://ajaykhatri.in
Implode Function
join elements of an array with a string
implode (separator, array)
Implode Function
Split a string by a specified string into
pieces (into an array)
explode (separator,string,limit)
http://ajaykhatri.inhttp://ajaykhatri.in
<?php
$post = array(
// …
'categories' => array('PHP', 'BTV')
);
echo implode(', ', $post['categories']);
// PHP, BTV
join elements of an array with a string
implode (separator, array)
http://ajaykhatri.inhttp://ajaykhatri.in
<?php
$post = array(
// …
'categories' =>
explode(', ', 'PHP, BTV')
);
print_r($post['categories']);
/*
Array
(
[0] => PHP
[1] => BTV
)
*/
http://ajaykhatri.inhttp://ajaykhatri.in
<?php
print_r(get_defined_functions());
/*
Array
(
[internal] => Array
(
[0] => zend_version
[1] => func_num_args
// …
)
[user] => Array
(
)
)
*/
http://ajaykhatri.inhttp://ajaykhatri.in
<?php
$functions = get_defined_functions();
echo count($functions['internal']);
// 1857
http://ajaykhatri.inhttp://ajaykhatri.in
<?php
$name = 'Marcus Börger';
if (function_exists('mb_strtolower')) {
echo mb_strtolower($name, 'UTF-8');
// marcus börger
} else {
echo strtolower($name);
// marcus b?rger
}
http://ajaykhatri.inhttp://ajaykhatri.in
Functions
http://ajaykhatri.inhttp://ajaykhatri.in
Built-in
<?php
echo strlen('Hello'); // 5
echo trim(' Hello '); // Hello
echo count(array(0, 1, 2, 3)); // 4
echo uniqid(); // 4c8a6660519d5
echo mt_rand(0, 9); // 3
echo serialize(42); // i:42;
echo json_encode(array('a' => 'b'));
// {"a":"b"}
http://ajaykhatri.inhttp://ajaykhatri.in
User-Defined Functions
http://ajaykhatri.inhttp://ajaykhatri.in
Rules
Any valid PHP code is allowed inside
functions, including other functions and class
definitions
Function names are case-insensitive
Once defined, a function cannot be undefined
http://ajaykhatri.inhttp://ajaykhatri.in
User-Defined
<?php
function add($x, $y)
{
return $x + $y;
}
echo add(2, 4); // 6
http://ajaykhatri.inhttp://ajaykhatri.in
Anonymous Functions
<?php
$sayHi = function ()
{
return 'Hi';
};
echo $sayHi(); // Hi
http://ajaykhatri.inhttp://ajaykhatri.in
Multiple Arguments
http://ajaykhatri.inhttp://ajaykhatri.in
<?php
function isPublished(DateTime $published,
$draft)
{
if ($draft) { return false; }
$now = new DateTime();
return $now >= $published;
}
$published = new
DateTime('2010-12-16T18:00:00-05:00');
$draft = false;
var_dump(isPublished($published, $draft));
// bool(true)
http://ajaykhatri.inhttp://ajaykhatri.in
Default Arguments
http://ajaykhatri.inhttp://ajaykhatri.in
<?php
function isPublished(DateTime $published,
$draft, $now = false)
{
if ($draft) { return false; }
$now = $now ? $now : new DateTime();
return $now >= $published;
}
$published = new
DateTime('2010-12-16T18:00:00-05:00');
$draft = false;
$now = new
DateTime('2010-12-16T17:59:59-05:00');
var_dump(isPublished($published, $draft,
$now));
// bool(false)
http://ajaykhatri.inhttp://ajaykhatri.in
Function Overloading
(not really)
http://ajaykhatri.inhttp://ajaykhatri.in
<?php
function nextId($arg1)
{
switch (true) {
case is_array($arg1):
return max(array_keys($arg1)) + 1;
case is_int($arg1):
return $arg1 + 1;
}
}
$posts = array(
1233 => array(/* … */),
1234 => array(/* … */),
);
echo nextId($posts); // 1235
echo nextId(1234); // 1235
http://ajaykhatri.inhttp://ajaykhatri.in
Variable Number of
Arguments
http://ajaykhatri.inhttp://ajaykhatri.in
<?php
function mostRecent()
{
$max = false;
foreach (func_get_args() as $arg) {
$max = $arg > $max ? $arg : $max;
}
return $max;
}
$mostRecent = mostRecent(
new DateTime('2010-12-14T18:00:00'),
new DateTime('2010-12-16T18:00:00'),
new DateTime('2010-12-15T18:00:00')
);
// 2010-12-16T18:00:00
http://ajaykhatri.inhttp://ajaykhatri.in
Learn PHP using
Android App
https://play.google.com/store/apps/details?id=learn.apps.phpprogramming
http://ajaykhatri.inhttp://ajaykhatri.in
Classes & Objects - PhP
Ajay Khatri
Senior Assistant Professor
Acropolis Institute of Technology & Research
www.ajaykhatri.in
https://play.google.com/store/apps/details?id=learn.apps.phpprogramming
http://ajaykhatri.inhttp://ajaykhatri.in
Classes & Objects
http://ajaykhatri.inhttp://ajaykhatri.in
Class Declaration
<?php
class Car
{
}
http://ajaykhatri.inhttp://ajaykhatri.in
Property Declaration
<?php
class Car
{
private $_hasSunroof = true;
}
http://ajaykhatri.inhttp://ajaykhatri.in
Method Declaration
<?php
class Car
{
public function hasSunroof()
{
return $this->_hasSunroof;
}
}
http://ajaykhatri.inhttp://ajaykhatri.in
Class Constants
<?php
class Car
{
const ENGINE_V4 = 'V4';
const ENGINE_V6 = 'V6';
const ENGINE_V8 = 'V8';
}
echo Car::ENGINE_V6; // V6
http://ajaykhatri.inhttp://ajaykhatri.in
Object Instantiation
& Member Access
<?php
$myCar = new Car();
if ($myCar->hasSunroof()) {
echo 'Yay!';
}
http://ajaykhatri.inhttp://ajaykhatri.in
Class Inheritance
<?php
class Chevy extends Car
{
}
http://ajaykhatri.inhttp://ajaykhatri.in
Member Visibility
http://ajaykhatri.inhttp://ajaykhatri.in
Public
Default visibility
Visible everywhere
http://ajaykhatri.inhttp://ajaykhatri.in
Protected
Visible to child classes
Visible to the object itself
Visible to other objects of the same type
http://ajaykhatri.inhttp://ajaykhatri.in
Private
Visible to the object itself
Visible within the defining class declaration
http://ajaykhatri.inhttp://ajaykhatri.in
Objects
http://ajaykhatri.inhttp://ajaykhatri.in
Basics
Encapsulate metadata and behavior
metadata => properties (variables, constants)
behavior => methods (functions)
http://ajaykhatri.inhttp://ajaykhatri.in
Anonymous Objects
http://ajaykhatri.inhttp://ajaykhatri.in
Cast an Associative
Array to (object)
<?php
$a = array(
'foo' => 'bar',
);
$o = (object) $a;
echo $o->foo; // 'bar'
http://ajaykhatri.inhttp://ajaykhatri.in
stdClass
$o = new stdClass;
$o->foo = 'bar';
echo $o->foo; // 'bar'
http://ajaykhatri.inhttp://ajaykhatri.in
Declaring a Class
<?php
class Foo
{
}
http://ajaykhatri.inhttp://ajaykhatri.in
Declaring Properties
<?php
class Foo
{
protected $bar = 'bar';
}
http://ajaykhatri.inhttp://ajaykhatri.in
Extending Classes
<?php
class FooBar extends Foo
{
}
http://ajaykhatri.inhttp://ajaykhatri.in
Modifiers
final: cannot be overridden in extending
classes
abstract: must be overridden in extending
classes
http://ajaykhatri.inhttp://ajaykhatri.in
Abstract Classes
http://ajaykhatri.inhttp://ajaykhatri.in
<?php
abstract class AbstractFoo
{
abstract public function sayBar();
}
class Foo extends AbstractFoo
{
public $bar;
public function sayBar()
{
echo $this->bar;
}
}
http://ajaykhatri.inhttp://ajaykhatri.in
Interfaces
"Blueprints" for classes
Typically indicate behaviors found in
implementing classes
You can implement many interfaces, but only
extend once
Allows you to compose multiple behaviors
into a single class
http://ajaykhatri.inhttp://ajaykhatri.in
Interfaces
<?php
interface Vehicle
{
public function hasSunroof();
}
http://ajaykhatri.inhttp://ajaykhatri.in
Implementing Interfaces
<?php
class Car implements Vehicle
{
public function hasSunroof()
{
return $this->_hasSunroof;
}
}
http://ajaykhatri.inhttp://ajaykhatri.in
<?php
interface Resource {
public function getResource();
}
interface Dispatcher {
public function dispatch();
}
abstract class DispatchableResource
implements Resource,Dispatcher
{
// …
}
http://ajaykhatri.inhttp://ajaykhatri.in
<?php
interface Resource { /* … */ }
interface Dispatcher { /* … */ }
abstract class DispatchableResource
implements Resource,Dispatcher
{
protected $resource;
public function getResource() {
return $this->resource;
}
public function dispatch() {
return 'Dispatched ' . $this-
>getResource();
}
}
http://ajaykhatri.inhttp://ajaykhatri.in
<?php
interface Resource { /* … */ }
interface Dispatcher { /* … */ }
abstract class DispatchableResource
implements Resource,Dispatcher { /* … */ }
class TrafficCop extends
DispatchableResource
{
protected $resource = 'traffic cop';
}
$cop = new TrafficCop();
echo $cop->dispatch();
// 'Dispatched traffic cop'
http://ajaykhatri.inhttp://ajaykhatri.in
Construct, Destruct, and
Invoke
__construct— Constructor (used when
"new Class" is called)
__destruct— Destructor (called when
object is destroyed)
__invoke— Call an object instance like a
function (echo $object();)
http://ajaykhatri.inhttp://ajaykhatri.in
Tools
http://ajaykhatri.inhttp://ajaykhatri.in
IDEs
Eclipse (PDT, Zend Studio, Aptana)
NetBeans
PHPStorm
Emacs
Vim
Many more…
http://ajaykhatri.inhttp://ajaykhatri.in
Frameworks
Zend Framework
Symfony
CodeIgniter
Agavi
CakePHP
Many more…
http://ajaykhatri.inhttp://ajaykhatri.in
Learn PHP using
Android App
https://play.google.com/store/apps/details?id=learn.apps.phpprogramming
http://ajaykhatri.inhttp://ajaykhatri.in
Questions?

More Related Content

What's hot

Let's write secure Drupal code! - DrupalCamp Oslo, 2018
Let's write secure Drupal code! - DrupalCamp Oslo, 2018Let's write secure Drupal code! - DrupalCamp Oslo, 2018
Let's write secure Drupal code! - DrupalCamp Oslo, 2018Balázs Tatár
 
Mirror, mirror on the wall: Building a new PHP reflection library (DPC 2016)
Mirror, mirror on the wall: Building a new PHP reflection library (DPC 2016)Mirror, mirror on the wall: Building a new PHP reflection library (DPC 2016)
Mirror, mirror on the wall: Building a new PHP reflection library (DPC 2016)James Titcumb
 
PHP Functions & Arrays
PHP Functions & ArraysPHP Functions & Arrays
PHP Functions & ArraysHenry Osborne
 
Let's write secure Drupal code! - Drupal Camp Poland 2019
Let's write secure Drupal code! - Drupal Camp Poland 2019Let's write secure Drupal code! - Drupal Camp Poland 2019
Let's write secure Drupal code! - Drupal Camp Poland 2019Balázs Tatár
 
(Parameterized) Roles
(Parameterized) Roles(Parameterized) Roles
(Parameterized) Rolessartak
 
Typed Properties and more: What's coming in PHP 7.4?
Typed Properties and more: What's coming in PHP 7.4?Typed Properties and more: What's coming in PHP 7.4?
Typed Properties and more: What's coming in PHP 7.4?Nikita Popov
 
Let's play a game with blackfire player
Let's play a game with blackfire playerLet's play a game with blackfire player
Let's play a game with blackfire playerMarcin Czarnecki
 
Let's write secure Drupal code! DUG Belgium - 08/08/2019
Let's write secure Drupal code! DUG Belgium - 08/08/2019Let's write secure Drupal code! DUG Belgium - 08/08/2019
Let's write secure Drupal code! DUG Belgium - 08/08/2019Balázs Tatár
 
PHP Enums - PHPCon Japan 2021
PHP Enums - PHPCon Japan 2021PHP Enums - PHPCon Japan 2021
PHP Enums - PHPCon Japan 2021Ayesh Karunaratne
 
Nikita Popov "What’s new in PHP 8.0?"
Nikita Popov "What’s new in PHP 8.0?"Nikita Popov "What’s new in PHP 8.0?"
Nikita Popov "What’s new in PHP 8.0?"Fwdays
 
Perl.Hacks.On.Vim
Perl.Hacks.On.VimPerl.Hacks.On.Vim
Perl.Hacks.On.VimLin Yo-An
 
PHP security audits
PHP security auditsPHP security audits
PHP security auditsDamien Seguy
 
Let's write secure drupal code! - Drupal Camp Pannonia 2019
Let's write secure drupal code! - Drupal Camp Pannonia 2019Let's write secure drupal code! - Drupal Camp Pannonia 2019
Let's write secure drupal code! - Drupal Camp Pannonia 2019Balázs Tatár
 
5 Tips for Better JavaScript
5 Tips for Better JavaScript5 Tips for Better JavaScript
5 Tips for Better JavaScriptTodd Anglin
 

What's hot (20)

Javascript
JavascriptJavascript
Javascript
 
Lettering js
Lettering jsLettering js
Lettering js
 
Let's write secure Drupal code! - DrupalCamp Oslo, 2018
Let's write secure Drupal code! - DrupalCamp Oslo, 2018Let's write secure Drupal code! - DrupalCamp Oslo, 2018
Let's write secure Drupal code! - DrupalCamp Oslo, 2018
 
Mirror, mirror on the wall: Building a new PHP reflection library (DPC 2016)
Mirror, mirror on the wall: Building a new PHP reflection library (DPC 2016)Mirror, mirror on the wall: Building a new PHP reflection library (DPC 2016)
Mirror, mirror on the wall: Building a new PHP reflection library (DPC 2016)
 
PHP Functions & Arrays
PHP Functions & ArraysPHP Functions & Arrays
PHP Functions & Arrays
 
Let's write secure Drupal code! - Drupal Camp Poland 2019
Let's write secure Drupal code! - Drupal Camp Poland 2019Let's write secure Drupal code! - Drupal Camp Poland 2019
Let's write secure Drupal code! - Drupal Camp Poland 2019
 
(Parameterized) Roles
(Parameterized) Roles(Parameterized) Roles
(Parameterized) Roles
 
PHPSpec BDD for PHP
PHPSpec BDD for PHPPHPSpec BDD for PHP
PHPSpec BDD for PHP
 
Typed Properties and more: What's coming in PHP 7.4?
Typed Properties and more: What's coming in PHP 7.4?Typed Properties and more: What's coming in PHP 7.4?
Typed Properties and more: What's coming in PHP 7.4?
 
Let's play a game with blackfire player
Let's play a game with blackfire playerLet's play a game with blackfire player
Let's play a game with blackfire player
 
Let's write secure Drupal code! DUG Belgium - 08/08/2019
Let's write secure Drupal code! DUG Belgium - 08/08/2019Let's write secure Drupal code! DUG Belgium - 08/08/2019
Let's write secure Drupal code! DUG Belgium - 08/08/2019
 
Php My Sql
Php My SqlPhp My Sql
Php My Sql
 
PHP Enums - PHPCon Japan 2021
PHP Enums - PHPCon Japan 2021PHP Enums - PHPCon Japan 2021
PHP Enums - PHPCon Japan 2021
 
Nikita Popov "What’s new in PHP 8.0?"
Nikita Popov "What’s new in PHP 8.0?"Nikita Popov "What’s new in PHP 8.0?"
Nikita Popov "What’s new in PHP 8.0?"
 
Perl.Hacks.On.Vim
Perl.Hacks.On.VimPerl.Hacks.On.Vim
Perl.Hacks.On.Vim
 
PHP security audits
PHP security auditsPHP security audits
PHP security audits
 
Your code is not a string
Your code is not a stringYour code is not a string
Your code is not a string
 
Let's write secure drupal code! - Drupal Camp Pannonia 2019
Let's write secure drupal code! - Drupal Camp Pannonia 2019Let's write secure drupal code! - Drupal Camp Pannonia 2019
Let's write secure drupal code! - Drupal Camp Pannonia 2019
 
5 Tips for Better JavaScript
5 Tips for Better JavaScript5 Tips for Better JavaScript
5 Tips for Better JavaScript
 
Javascript basics
Javascript basicsJavascript basics
Javascript basics
 

Similar to Introduction to PHP Lecture 1

Similar to Introduction to PHP Lecture 1 (20)

Introduction to PHP
Introduction to PHPIntroduction to PHP
Introduction to PHP
 
Intermediate PHP
Intermediate PHPIntermediate PHP
Intermediate PHP
 
[PL] Jak nie zostać "programistą" PHP?
[PL] Jak nie zostać "programistą" PHP?[PL] Jak nie zostać "programistą" PHP?
[PL] Jak nie zostać "programistą" PHP?
 
PHP
PHP PHP
PHP
 
What's new, what's hot in PHP 5.3
What's new, what's hot in PHP 5.3What's new, what's hot in PHP 5.3
What's new, what's hot in PHP 5.3
 
PHP Basics and Demo HackU
PHP Basics and Demo HackUPHP Basics and Demo HackU
PHP Basics and Demo HackU
 
Aura Project for PHP
Aura Project for PHPAura Project for PHP
Aura Project for PHP
 
PHP Workshop Notes
PHP Workshop NotesPHP Workshop Notes
PHP Workshop Notes
 
Php Tutorials for Beginners
Php Tutorials for BeginnersPhp Tutorials for Beginners
Php Tutorials for Beginners
 
php AND MYSQL _ppt.pdf
php AND MYSQL _ppt.pdfphp AND MYSQL _ppt.pdf
php AND MYSQL _ppt.pdf
 
Php hacku
Php hackuPhp hacku
Php hacku
 
Writing Friendly libraries for CodeIgniter
Writing Friendly libraries for CodeIgniterWriting Friendly libraries for CodeIgniter
Writing Friendly libraries for CodeIgniter
 
PHP Tips for certification - OdW13
PHP Tips for certification - OdW13PHP Tips for certification - OdW13
PHP Tips for certification - OdW13
 
PHP for hacks
PHP for hacksPHP for hacks
PHP for hacks
 
2014 database - course 2 - php
2014 database - course 2 - php2014 database - course 2 - php
2014 database - course 2 - php
 
Web 8 | Introduction to PHP
Web 8 | Introduction to PHPWeb 8 | Introduction to PHP
Web 8 | Introduction to PHP
 
Php Lecture Notes
Php Lecture NotesPhp Lecture Notes
Php Lecture Notes
 
What's new in PHP 8.0?
What's new in PHP 8.0?What's new in PHP 8.0?
What's new in PHP 8.0?
 
PHP-04-Arrays.ppt
PHP-04-Arrays.pptPHP-04-Arrays.ppt
PHP-04-Arrays.ppt
 
Php
PhpPhp
Php
 

More from Ajay Khatri

Ajay khatri resume august 2021
Ajay khatri resume august 2021Ajay khatri resume august 2021
Ajay khatri resume august 2021Ajay Khatri
 
Lecture 1 Introduction C++
Lecture 1 Introduction C++Lecture 1 Introduction C++
Lecture 1 Introduction C++Ajay Khatri
 
Competitive Programming Guide
Competitive Programming GuideCompetitive Programming Guide
Competitive Programming GuideAjay Khatri
 
Zotero : Personal Research Assistant
Zotero : Personal Research AssistantZotero : Personal Research Assistant
Zotero : Personal Research AssistantAjay Khatri
 
Basics of C programming - day 2
Basics of C programming - day 2Basics of C programming - day 2
Basics of C programming - day 2Ajay Khatri
 
Introduction to HTML
Introduction to HTMLIntroduction to HTML
Introduction to HTMLAjay Khatri
 
Introduction To MySQL Lecture 1
Introduction To MySQL Lecture 1Introduction To MySQL Lecture 1
Introduction To MySQL Lecture 1Ajay Khatri
 
CSS Basics (Cascading Style Sheet)
CSS Basics (Cascading Style Sheet)CSS Basics (Cascading Style Sheet)
CSS Basics (Cascading Style Sheet)Ajay Khatri
 

More from Ajay Khatri (8)

Ajay khatri resume august 2021
Ajay khatri resume august 2021Ajay khatri resume august 2021
Ajay khatri resume august 2021
 
Lecture 1 Introduction C++
Lecture 1 Introduction C++Lecture 1 Introduction C++
Lecture 1 Introduction C++
 
Competitive Programming Guide
Competitive Programming GuideCompetitive Programming Guide
Competitive Programming Guide
 
Zotero : Personal Research Assistant
Zotero : Personal Research AssistantZotero : Personal Research Assistant
Zotero : Personal Research Assistant
 
Basics of C programming - day 2
Basics of C programming - day 2Basics of C programming - day 2
Basics of C programming - day 2
 
Introduction to HTML
Introduction to HTMLIntroduction to HTML
Introduction to HTML
 
Introduction To MySQL Lecture 1
Introduction To MySQL Lecture 1Introduction To MySQL Lecture 1
Introduction To MySQL Lecture 1
 
CSS Basics (Cascading Style Sheet)
CSS Basics (Cascading Style Sheet)CSS Basics (Cascading Style Sheet)
CSS Basics (Cascading Style Sheet)
 

Recently uploaded

MARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptxMARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptxbennyroshan06
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxRaedMohamed3
 
Solid waste management & Types of Basic civil Engineering notes by DJ Sir.pptx
Solid waste management & Types of Basic civil Engineering notes by DJ Sir.pptxSolid waste management & Types of Basic civil Engineering notes by DJ Sir.pptx
Solid waste management & Types of Basic civil Engineering notes by DJ Sir.pptxDenish Jangid
 
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxStudents, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxEduSkills OECD
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfTamralipta Mahavidyalaya
 
Gyanartha SciBizTech Quiz slideshare.pptx
Gyanartha SciBizTech Quiz slideshare.pptxGyanartha SciBizTech Quiz slideshare.pptx
Gyanartha SciBizTech Quiz slideshare.pptxShibin Azad
 
Salient features of Environment protection Act 1986.pptx
Salient features of Environment protection Act 1986.pptxSalient features of Environment protection Act 1986.pptx
Salient features of Environment protection Act 1986.pptxakshayaramakrishnan21
 
INU_CAPSTONEDESIGN_비밀번호486_업로드용 발표자료.pdf
INU_CAPSTONEDESIGN_비밀번호486_업로드용 발표자료.pdfINU_CAPSTONEDESIGN_비밀번호486_업로드용 발표자료.pdf
INU_CAPSTONEDESIGN_비밀번호486_업로드용 발표자료.pdfbu07226
 
50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...
50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...
50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...Nguyen Thanh Tu Collection
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxPavel ( NSTU)
 
Jose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptx
Jose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptxJose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptx
Jose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptxricssacare
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxJheel Barad
 
Basic_QTL_Marker-assisted_Selection_Sourabh.ppt
Basic_QTL_Marker-assisted_Selection_Sourabh.pptBasic_QTL_Marker-assisted_Selection_Sourabh.ppt
Basic_QTL_Marker-assisted_Selection_Sourabh.pptSourabh Kumar
 
Matatag-Curriculum and the 21st Century Skills Presentation.pptx
Matatag-Curriculum and the 21st Century Skills Presentation.pptxMatatag-Curriculum and the 21st Century Skills Presentation.pptx
Matatag-Curriculum and the 21st Century Skills Presentation.pptxJenilouCasareno
 
[GDSC YCCE] Build with AI Online Presentation
[GDSC YCCE] Build with AI Online Presentation[GDSC YCCE] Build with AI Online Presentation
[GDSC YCCE] Build with AI Online PresentationGDSCYCCE
 
Industrial Training Report- AKTU Industrial Training Report
Industrial Training Report- AKTU Industrial Training ReportIndustrial Training Report- AKTU Industrial Training Report
Industrial Training Report- AKTU Industrial Training ReportAvinash Rai
 
How to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPHow to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPCeline George
 

Recently uploaded (20)

MARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptxMARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 
Solid waste management & Types of Basic civil Engineering notes by DJ Sir.pptx
Solid waste management & Types of Basic civil Engineering notes by DJ Sir.pptxSolid waste management & Types of Basic civil Engineering notes by DJ Sir.pptx
Solid waste management & Types of Basic civil Engineering notes by DJ Sir.pptx
 
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxStudents, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
 
Operations Management - Book1.p - Dr. Abdulfatah A. Salem
Operations Management - Book1.p  - Dr. Abdulfatah A. SalemOperations Management - Book1.p  - Dr. Abdulfatah A. Salem
Operations Management - Book1.p - Dr. Abdulfatah A. Salem
 
Gyanartha SciBizTech Quiz slideshare.pptx
Gyanartha SciBizTech Quiz slideshare.pptxGyanartha SciBizTech Quiz slideshare.pptx
Gyanartha SciBizTech Quiz slideshare.pptx
 
Salient features of Environment protection Act 1986.pptx
Salient features of Environment protection Act 1986.pptxSalient features of Environment protection Act 1986.pptx
Salient features of Environment protection Act 1986.pptx
 
INU_CAPSTONEDESIGN_비밀번호486_업로드용 발표자료.pdf
INU_CAPSTONEDESIGN_비밀번호486_업로드용 발표자료.pdfINU_CAPSTONEDESIGN_비밀번호486_업로드용 발표자료.pdf
INU_CAPSTONEDESIGN_비밀번호486_업로드용 발표자료.pdf
 
Mattingly "AI & Prompt Design: Limitations and Solutions with LLMs"
Mattingly "AI & Prompt Design: Limitations and Solutions with LLMs"Mattingly "AI & Prompt Design: Limitations and Solutions with LLMs"
Mattingly "AI & Prompt Design: Limitations and Solutions with LLMs"
 
50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...
50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...
50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
Jose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptx
Jose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptxJose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptx
Jose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptx
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
Basic_QTL_Marker-assisted_Selection_Sourabh.ppt
Basic_QTL_Marker-assisted_Selection_Sourabh.pptBasic_QTL_Marker-assisted_Selection_Sourabh.ppt
Basic_QTL_Marker-assisted_Selection_Sourabh.ppt
 
Matatag-Curriculum and the 21st Century Skills Presentation.pptx
Matatag-Curriculum and the 21st Century Skills Presentation.pptxMatatag-Curriculum and the 21st Century Skills Presentation.pptx
Matatag-Curriculum and the 21st Century Skills Presentation.pptx
 
[GDSC YCCE] Build with AI Online Presentation
[GDSC YCCE] Build with AI Online Presentation[GDSC YCCE] Build with AI Online Presentation
[GDSC YCCE] Build with AI Online Presentation
 
Industrial Training Report- AKTU Industrial Training Report
Industrial Training Report- AKTU Industrial Training ReportIndustrial Training Report- AKTU Industrial Training Report
Industrial Training Report- AKTU Industrial Training Report
 
How to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPHow to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERP
 

Introduction to PHP Lecture 1

Editor's Notes

  1. A string can hold letters, numbers, and special characters and it can be as large as up to 2GB (2147483647 bytes maximum)