SlideShare a Scribd company logo
1 of 50
Download to read offline
PHP Crash Course
  Macq Electronique, Brussels 2010
          Michelangelo van Dam
Targeted audience


experience with development languages
knowledge about programming routines
         types and functions

this is not “development for newbies” !
Michelangelo van Dam

• Independent Consultant
• Zend Certified Engineer (ZCE)
 - PHP 4 & PHP 5
 - Zend Framework
• Co-Founder of PHPBenelux
• Shepherd of “elephpant” herdes
T AIL O RM A D E S O L U T I O N S




                                         Macq électronique, manufacturer and developer, proposes
                                         you a whole series of electronic and computing-processing
                                         solutions for industry, building and road traffic.

                                         Macq électronique has set itself two objectives which are
                                         essential for our company :

                                              developing with competence and innovation
                                              earning the confidence of our customers

                                         Macq électronique presents many references carried out
                                         the last few years which attest to its human and
                                         technical abilities to meet with the greatest efficiency
                                         the needs of its customers.




For more information, please check out our website
              http://www.macqel.eu
What is PHP ?
• most popular language for dynamic web sites
• open-source (part of popularity)
•- pre-processed programming language
    no need to compile
• simple to learn (low entry level)
• easy to shoot yourself in your foot ! (no kidding)
PHP is a “Ball of nails”

“When I say that PHP is a
ball of nails, basically, PHP is
just this piece of shit that
you just put together—put
all the parts together—and
you throw it against the wall
and it fucking sticks.”
Terry Chay
History of PHP
•- 1995: Rasmus Lerdorf created PHP
   for maintaining his own resume on the web
 - called it “Personal Home Page”
 - improved it with a Form interpreter (PHP-FI)
• 1997: Zeev Zuraski and Andi Gutmans
 - rewrote first parser for PHP v3
 - renamed it “PHP: Hypertext Preprocessor”
• 1998: Zeev Zuraski and Andi Gutmans
 - redesigned the parser for PHP 4 (Zend Engine)
 - founded Zend Technologies, Inc.
Why PHP ?
Seriously, who uses PHP ?

“PHP is currently the most
popular server-side web
programming language. It runs
33,53%˙ of the websites on the
Internet.”
Source: wheel.troxo.com
˙ data from 2007 !!!

PHP powers adult websites !!!
Starting with PHP
•- Minimum Requirements:
   php hypertext preprocessor (www.php.net)
 - a text editor (notepad, textpad, vi, pico, emacs, …)
• Preferred requirements:
 - LAMP: Linux, Apache, MySQL, PHP
 - WAMP: Windows, Apache, MySQL, PHP
 - WIMP: Windows, IIS, MS SQL, PHP
 - SPAM: Solaris, PHP, Apache, MySQL
 - Mac OS X
Where to start ?




    http://php.net
Easy installation




http://www.zend.com/community/zend-server-ce
My first PHP code
Put the following code in file “helloWorld.php”:
<?php

echo 'Hello World';

?>


To execute this code you can just use
user@server: $ /usr/local/zend/bin/php ./helloWorld.php


And it will output
Hello Worlduser@server: $
What about websites ?
Some dry theory first
• Basic syntax              • Exceptions
• Types                     • References Explained
• Variables                 • Predefined Variables
• Constants                 • Predefined Exceptions
• Expressions               • Predefined Interfaces
• Operators                 • Context options and
• Control Structures           parameters
• Functions
• Classes and Objects
• Namespaces
   Same as on http://php.net/manual/en/langref.php
Basic syntax
• Escaping from HTML
• Instruction separation
• Comments
Escape from HTML
Simple escaping:
<p>This is going to be ignored.</p>
<?php echo 'While this is going to be parsed.'; ?>
<p>This will also be ignored.</p>


Advanced escaping:
<?php
if ($expression) {
    ?>
    <strong>This is true.</strong>
    <?php
} else {
    ?>
    <strong>This is false.</strong>
    <?php
}
?>
Instruction separation
<?php
    echo 'This is a test';
?>

<?php echo 'This is a test' ?>

<?php echo 'We omitted the last closing tag';
Comments
<?php

// single line comment

if ($condition) { // another single line c++ style comment
    /* This is a multi-line comment
       that spans over multiple lines */
    echo 'This is a test';
    echo 'This is another test'; # with a single line shell style comment
}


A common mistake is to nest multi-line comments !
/* This multi-line comment
   /* has a nested multi-line comment
      spanning two lines */
*/


The last */ will never be reached !!!
Types
• Booleans            • Objects
• Integers            • Resources
• Floating point      • NULL
  numbers             • Pseudo-types
• Strings             • Type Juggling
• Arrays
Scalar types
• boolean (have a TRUE or FALSE state)
•- integer (decimal, octal or hexadecimal)
    positive numbers (1,204, …)
 - negative numbers (-9, -128, …)
 - hexadecimal numbers (0x1A, 0xFF, …)
 - octal numbers (0123, 0777, …)
• float (a.k.a. floats, doubles, real numbers)
 - 1.234, 1.2e3, 7E-10, …
• string
Single quoted strings
<?php
echo 'this is a simple string';          // this is a simple string

echo 'this is a ' . 'combined string';   // this is a combined string

echo 'this is a multi-                   // this is a multi-line string
line string';

echo 'I'm an escaped character string'; // I'm an escaped character string

$var = '[var]';
echo 'this $var is not processed';       // this $var is not processed
Double quoted strings
<?php
echo "this is a simple string";           // this is a simple string

echo "this is a " . "combined string";    // this is a combined string

echo "this is a multi-                    // this is a multi-line string
line string";

echo "I'm an escaped character string"; // I'm an escaped character string

$var = '[var]';
echo "this $var is processed";           // this [var] is processed
Compound Types
• array
• object
Arrays
•- ordered map
   collection of keys and values
  ❖ keys: can only be an integer or a string
  ❖ values: can be of any type
Example arrays
$myArray = array (1, 2, 3, 4);           // array[0] = 1; array[1] = 2;
                                         // array[2] = 3;

$myArray = array (1, 'Hello World');     // array[0] = 1;
                                         // array[1] = 'Hello World';

$myArray = array (1 => 'a', 2 => 'b');   // array[1] = 'a'; array[2] = 'b';

$myArray = array ('a' => 1, 'b' => 2);   // array['a'] = 1; array['b'] = 2;

$myArray = array (
    'a' => array (1, 2, true),           // array['a'] = array[0] = 1;
                                         //              array[1] = 2;
                                         //              array[2] = true;
     'b' => array (                      // array['b'] =
        'a' = 1,                         //    array['a'] = 1;
        'b' = false,                     //    array['b'] = false;
        'c',                             //    array[0] = 'c';
     ),
);
Objects
<?php
class foo
{
    function do_foo()
    {
        echo "Doing foo.";
    }
}

$bar = new foo;
$bar->do_foo();
?>


Outputs
Doing foo


More about objects in the advanced PHP session…
Special Types
• resource
• NULL
Resource
•- Special type
   holds a reference to an external source
  ❖ a database, a file, a stream, …
 - can be used to verify a resource type
NULL
• represents a variable with no value
•- a variable is considered null
     when assigned the NULL constant
 -   it has no value assigned yet
 -   has been emptied by unset()
Pseudo Types
• mixed: used for any type
• number: used for integers and floats
•- callback:
     a function (name) is used as parameter
 -   a closure or anonymous function (as of PHP 5.3)
 -   cannot be a language construct
Type Juggling
• no explicit type definitions of variables
•- type of variable can change
     remember the shoot in the foot part !
• enforced type casting to validate types


                   Confused yet ?
Type Juggling example
<?php
$foo = "0";                       //   $foo   is   string (ASCII 48)
$foo += 2;                        //   $foo   is   now an integer (2)
$foo = $foo + 1.3;                //   $foo   is   now a float (3.3)
$foo = 5 + "10 Little Piggies";   //   $foo   is   integer (15)
$foo = 5 + "20 Small Pigs";       //   $foo   is   integer (25)
?>
Variables
• Basics
• Predefined variables
• Variable scope
• Variable variables
Basics
<?php

$var = 'Bob';
$Var = 'Joe';
echo "$var, $Var";     // outputs "Bob, Joe"

$4site = 'not yet';    // invalid; starts with a number
$_4site = 'not yet';   // valid; starts with an underscore
$täyte = 'mansikka';   // valid; 'ä' is (Extended) ASCII 228.
Basics in PHP 6
Predefined Variables
•   Superglobals: are built-in variables (always available in all scopes)
•   $GLOBALS: References all variables available in global scope
•   $_SERVER: Server and execution environment information
•   $_GET: HTTP GET variables
•   $_POST: HTTP POST variables
•   $_FILES: HTTP File Upload variables
•   $_REQUEST: HTTP Request variables
•   $_SESSION: Session variables
•   $_ENV: Environment variables
•   $_COOKIE: HTTP Cookies
•   $php_errormsg: The previous error message
•   $HTTP_RAW_POST_DATA: Raw POST data
•   $http_response_header: HTTP response headers
•   $argc: The number of arguments passed to script
•   $argv: Array of arguments passed to script
Variable Scope
context in which a variable is defined
<?php
$a = 1;
include ‘file.inc.php’; // $a is known inside the included script


global scope
<?php

$a = 1;
$b = 2;

function foo()
{
    global $a, $b;
    echo $b = $a + $b;
}

foo();   // outputs 3
echo $b; // outputs 3 ($b is known outside it’s scope)
Variable Variables
<?php

$a = ‘php’;        // value ‘php’ stored in $a

$$a = ‘rules’;     // value ‘rules’ stored in $$a (or $php)

echo “$a ${$a}”;   // outputs ‘php rules’

echo “$a $php”;    // outputs ‘php rules’
Constants
• an identifier (name) for a simple value
• that value cannot change
• is case-sensitive by default
• are always uppercase (by convention)
•- 2 types
     basic
 -   magic
Basic Constants
<?php

define(‘CONSTANT’, ‘value’);
define(‘KEY_ELEMENT’, 1);
define(‘SYNTAX_CHECK’, true);

echo CONSTANT // outputs ‘value’
echo Constant // outputs ‘Constant’ and issues a notice


As of PHP 5.3
const CONSTANT = ‘value’;

echo CONSTANT; // ouputs ‘value’
Magic Constants
• __LINE__: current line number of the file
• __FILE__: full path and filename of the file
• __DIR__: directory of the file
• __FUNCTION__: function name (cs)
• __CLASS__: class name (cs)
• __METHOD__: class method name (cs)
• __NAMESPACE__: current namespace (cs)
Expressions
$a = 5;

function foo()
{
   return ‘bar’;
}

0 < $a ? true : false;

$a = $b = 2; // both $a and $b have a value of 2
$c = ++$b;   // $c has value 3 and $b has value 3
$d = $c++;   // $d has value 3 and $c has value 4
Operators
•   Operator Precedence
•   Arithmetic Operators
•   Assignment Operators
•   Bitwise Operators
•   Comparison Operators
•   Error Control Operators
•   Execution Operators
•   Incrementing/Decrementing Operators
•   Logical Operators
•   String Operators
•   Array Operators
•   Type Operators
Control structures
• if               • declare
• else             • return
• elseif/else if   • require
• while            • include
• do-while         • require_once
• for              • include_once
• foreach          • goto
• break
• continue
• switch
Functions
<?php
function a($n){
  b($n);
  return ($n * $n);
}

function b(&$n){
  $n++;
}

echo a(5); //Outputs 36
Next step: advanced PHP


       Classes and Objects
           Abstraction
             Security
       PHP Hidden Gems
Recommended Reading
               CYAN                    YELLOW
               MAGENTA                 BLACK




                                                      BOOKS FOR PROFESSIONALS BY PROFESSIONALS ®                                                                           THE EXPERT’S VOICE® IN OPEN SOURCE
                                                                                                                                                  Companion
                                                                                                                                                    eBook
                                                                                                                                                   Available

                                                         PHP for Absolute Beginners




                                                                                                                                              PHP for Absolute Beginners
                                                         Dear Reader,
                                                         PHP for Absolute Beginners will take you from zero to full-speed with PHP pro-
                                                         gramming in an easy-to-understand, practical manner. Rather than building




                                                                                                                                                                           PHP
                                                         applications with no real-world use, this book teaches you PHP by walking you
                                                         through the development of a blogging web site.
                                                             You’ll start by creating a simple web-ready blog, then you'll learn how to add
                                                         password-protected controls, support for multiple pages, the ability to upload
                                                         and resize images, a user comment system, and finally, how to integrate with
                                                         sites like Twitter.
                                                             Along the way, you'll also learn a few advanced tricks including creating
                                                         friendly URLs with .htaccess, using regular expressions, object-oriented pro-
                                                         gramming, and more.
                                                             I wrote this book to help you make the leap to PHP developer in hopes that
                                                         you can put your valuable skills to work for your company, your clients, or on
                                                         your own personal blog. The concepts in this book will leave you ready to take
                                                         on the challenges of the new online world, all while having fun!




PHP for Absolute Beginners                                                                                                                                                 for Absolute Beginners
                                                         Jason Lengstorf



                                                       THE APRESS ROADMAP




Apress
                                                                                        PHP Objects, Patterns,         Pro PHP:
                                                                       PHP for
                                                                                            and Practice         Patterns, Frameworks,
                                                                  Absolute Beginners
                                                                                                                   Testing, and More

                                                                    Beginning PHP         Practical Web 2.0
                                                                     and MySQL           Applications with PHP




Jason Lengstorf                                                                                                                                                                                                Everything you need to know to
                                                                                        Beginning Ajax and PHP
                   Companion eBook
                                                                                                                                                                                                               get started with PHP


                  See last page for details
                   on $10 eBook version




                                                                                                                                                       Lengstorf
               SOURCE CODE ONLINE
               www.apress.com
                                                                                                                                                                           Jason Lengstorf
               US $34.99

               Shelve in:
               PHP

               User level:
               Beginner




                                              this print for content only—size & color not accurate                                                                              trim = 7.5" x 9.25" spine = 0.75" 408 page count
Credits
                      Ball of nails - Count Rushmore
          http://flickr.com/photos/countrushmore/2437899191

                 Life is too short for Java - Terry Chay
              http://flickr.com/photos/tychay/1388234558

              Ruby Fails - IBSpoof (stickers by @spooons)
           http://www.flickr.com/photos/ibspoof/2879088241

                          Monkey Face - Mr Pins
          http://flickr.com/photos/7359188@N02/1358576877

           Unicode Identifiers - Andrei Zmievski / Andrew Mager
http://andrewmager.com/geeksessions-13-php-scalability-and-performance/

                          Confused - Kristian D.
             http://flickr.com/photos/kristiand/3223044657
Questions ?

        Slides on SlideShare
http://www.slideshare.net/DragonBe

          Give feedback !
        http://joind.in/1256

More Related Content

What's hot

PHP Enums - PHPCon Japan 2021
PHP Enums - PHPCon Japan 2021PHP Enums - PHPCon Japan 2021
PHP Enums - PHPCon Japan 2021Ayesh Karunaratne
 
Php course-in-navimumbai
Php course-in-navimumbaiPhp course-in-navimumbai
Php course-in-navimumbaivibrantuser
 
Static Optimization of PHP bytecode (PHPSC 2017)
Static Optimization of PHP bytecode (PHPSC 2017)Static Optimization of PHP bytecode (PHPSC 2017)
Static Optimization of PHP bytecode (PHPSC 2017)Nikita Popov
 
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
 
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?Nikita Popov
 
Just-In-Time Compiler in PHP 8
Just-In-Time Compiler in PHP 8Just-In-Time Compiler in PHP 8
Just-In-Time Compiler in PHP 8Nikita Popov
 
PHP Performance Trivia
PHP Performance TriviaPHP Performance Trivia
PHP Performance TriviaNikita Popov
 
Your code sucks, let's fix it! - php|tek13
Your code sucks, let's fix it! - php|tek13Your code sucks, let's fix it! - php|tek13
Your code sucks, let's fix it! - php|tek13Rafael Dohms
 
Php i basic chapter 3 (mardhiah kamaludin's conflicted copy 2013-04-23)
Php i basic chapter 3 (mardhiah kamaludin's conflicted copy 2013-04-23)Php i basic chapter 3 (mardhiah kamaludin's conflicted copy 2013-04-23)
Php i basic chapter 3 (mardhiah kamaludin's conflicted copy 2013-04-23)Muhamad Al Imran
 
Class 2 - Introduction to PHP
Class 2 - Introduction to PHPClass 2 - Introduction to PHP
Class 2 - Introduction to PHPAhmed Swilam
 
Zend Certification Preparation Tutorial
Zend Certification Preparation TutorialZend Certification Preparation Tutorial
Zend Certification Preparation TutorialLorna Mitchell
 

What's hot (20)

PHP Enums - PHPCon Japan 2021
PHP Enums - PHPCon Japan 2021PHP Enums - PHPCon Japan 2021
PHP Enums - PHPCon Japan 2021
 
Php i basic chapter 3
Php i basic chapter 3Php i basic chapter 3
Php i basic chapter 3
 
Php course-in-navimumbai
Php course-in-navimumbaiPhp course-in-navimumbai
Php course-in-navimumbai
 
PHP - Introduction to PHP Date and Time Functions
PHP -  Introduction to  PHP Date and Time FunctionsPHP -  Introduction to  PHP Date and Time Functions
PHP - Introduction to PHP Date and Time Functions
 
Static Optimization of PHP bytecode (PHPSC 2017)
Static Optimization of PHP bytecode (PHPSC 2017)Static Optimization of PHP bytecode (PHPSC 2017)
Static Optimization of PHP bytecode (PHPSC 2017)
 
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?"
 
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?
 
Basic PHP
Basic PHPBasic PHP
Basic PHP
 
Introduction to php php++
Introduction to php php++Introduction to php php++
Introduction to php php++
 
Just-In-Time Compiler in PHP 8
Just-In-Time Compiler in PHP 8Just-In-Time Compiler in PHP 8
Just-In-Time Compiler in PHP 8
 
Sorting arrays in PHP
Sorting arrays in PHPSorting arrays in PHP
Sorting arrays in PHP
 
PHP Performance Trivia
PHP Performance TriviaPHP Performance Trivia
PHP Performance Trivia
 
New in php 7
New in php 7New in php 7
New in php 7
 
Your code sucks, let's fix it! - php|tek13
Your code sucks, let's fix it! - php|tek13Your code sucks, let's fix it! - php|tek13
Your code sucks, let's fix it! - php|tek13
 
Php i basic chapter 3 (mardhiah kamaludin's conflicted copy 2013-04-23)
Php i basic chapter 3 (mardhiah kamaludin's conflicted copy 2013-04-23)Php i basic chapter 3 (mardhiah kamaludin's conflicted copy 2013-04-23)
Php i basic chapter 3 (mardhiah kamaludin's conflicted copy 2013-04-23)
 
Class 2 - Introduction to PHP
Class 2 - Introduction to PHPClass 2 - Introduction to PHP
Class 2 - Introduction to PHP
 
Introduction to php basics
Introduction to php   basicsIntroduction to php   basics
Introduction to php basics
 
Basic of PHP
Basic of PHPBasic of PHP
Basic of PHP
 
Zend Certification Preparation Tutorial
Zend Certification Preparation TutorialZend Certification Preparation Tutorial
Zend Certification Preparation Tutorial
 
Basics PHP
Basics PHPBasics PHP
Basics PHP
 

Viewers also liked

Perk Up Your Projects with Web 2.0 - MCIU
Perk Up Your Projects with Web 2.0 - MCIUPerk Up Your Projects with Web 2.0 - MCIU
Perk Up Your Projects with Web 2.0 - MCIUDianne Krause
 
PHP in the Cloud
PHP in the CloudPHP in the Cloud
PHP in the CloudAcquia
 
Electronic Discovery and Other Electronic Communications
Electronic Discovery and Other Electronic CommunicationsElectronic Discovery and Other Electronic Communications
Electronic Discovery and Other Electronic CommunicationsAnapol Weiss
 
Creating an inclusive STEM culture
Creating an inclusive STEM cultureCreating an inclusive STEM culture
Creating an inclusive STEM cultureCatherine Cronin
 
Non-medical Community and Home Healthcare Career
Non-medical Community and Home Healthcare CareerNon-medical Community and Home Healthcare Career
Non-medical Community and Home Healthcare CareerRAVI SHANKAR
 
Collaborative social platforms for agriculture extension”
Collaborative social platforms for agriculture extension”Collaborative social platforms for agriculture extension”
Collaborative social platforms for agriculture extension”Anne Adrian
 

Viewers also liked (8)

Perk Up Your Projects with Web 2.0 - MCIU
Perk Up Your Projects with Web 2.0 - MCIUPerk Up Your Projects with Web 2.0 - MCIU
Perk Up Your Projects with Web 2.0 - MCIU
 
PHP in the Cloud
PHP in the CloudPHP in the Cloud
PHP in the Cloud
 
Electronic Discovery and Other Electronic Communications
Electronic Discovery and Other Electronic CommunicationsElectronic Discovery and Other Electronic Communications
Electronic Discovery and Other Electronic Communications
 
Photos and You
Photos and YouPhotos and You
Photos and You
 
Creating an inclusive STEM culture
Creating an inclusive STEM cultureCreating an inclusive STEM culture
Creating an inclusive STEM culture
 
Social media
Social mediaSocial media
Social media
 
Non-medical Community and Home Healthcare Career
Non-medical Community and Home Healthcare CareerNon-medical Community and Home Healthcare Career
Non-medical Community and Home Healthcare Career
 
Collaborative social platforms for agriculture extension”
Collaborative social platforms for agriculture extension”Collaborative social platforms for agriculture extension”
Collaborative social platforms for agriculture extension”
 

Similar to Php Crash Course - Macq Electronique 2010

Similar to Php Crash Course - Macq Electronique 2010 (20)

PHP Basics and Demo HackU
PHP Basics and Demo HackUPHP Basics and Demo HackU
PHP Basics and Demo HackU
 
MIND sweeping introduction to PHP
MIND sweeping introduction to PHPMIND sweeping introduction to PHP
MIND sweeping introduction to PHP
 
php fundamental
php fundamentalphp fundamental
php fundamental
 
Php introduction with history of php
Php introduction with history of phpPhp introduction with history of php
Php introduction with history of php
 
php
phpphp
php
 
Introduction in php
Introduction in phpIntroduction in php
Introduction in php
 
05php
05php05php
05php
 
Php basics
Php basicsPhp basics
Php basics
 
PHP from soup to nuts Course Deck
PHP from soup to nuts Course DeckPHP from soup to nuts Course Deck
PHP from soup to nuts Course Deck
 
Hsc IT 5. Server-Side Scripting (PHP).pdf
Hsc IT 5. Server-Side Scripting (PHP).pdfHsc IT 5. Server-Side Scripting (PHP).pdf
Hsc IT 5. Server-Side Scripting (PHP).pdf
 
PHP
PHPPHP
PHP
 
php (Hypertext Preprocessor)
php (Hypertext Preprocessor)php (Hypertext Preprocessor)
php (Hypertext Preprocessor)
 
Prersentation
PrersentationPrersentation
Prersentation
 
Php basics
Php basicsPhp basics
Php basics
 
Ppt php
Ppt phpPpt php
Ppt php
 
Php converted pdf
Php converted pdfPhp converted pdf
Php converted pdf
 
05php
05php05php
05php
 
PHP Basics
PHP BasicsPHP Basics
PHP Basics
 
rtwerewr
rtwerewrrtwerewr
rtwerewr
 
HackU PHP and Node.js
HackU PHP and Node.jsHackU PHP and Node.js
HackU PHP and Node.js
 

More from Michelangelo van Dam

GDPR Art. 25 - Privacy by design and default
GDPR Art. 25 - Privacy by design and defaultGDPR Art. 25 - Privacy by design and default
GDPR Art. 25 - Privacy by design and defaultMichelangelo van Dam
 
Moving from app services to azure functions
Moving from app services to azure functionsMoving from app services to azure functions
Moving from app services to azure functionsMichelangelo van Dam
 
General Data Protection Regulation, a developer's story
General Data Protection Regulation, a developer's storyGeneral Data Protection Regulation, a developer's story
General Data Protection Regulation, a developer's storyMichelangelo van Dam
 
Leveraging a distributed architecture to your advantage
Leveraging a distributed architecture to your advantageLeveraging a distributed architecture to your advantage
Leveraging a distributed architecture to your advantageMichelangelo van Dam
 
Open source for a successful business
Open source for a successful businessOpen source for a successful business
Open source for a successful businessMichelangelo van Dam
 
Decouple your framework now, thank me later
Decouple your framework now, thank me laterDecouple your framework now, thank me later
Decouple your framework now, thank me laterMichelangelo van Dam
 
Deploy to azure in less then 15 minutes
Deploy to azure in less then 15 minutesDeploy to azure in less then 15 minutes
Deploy to azure in less then 15 minutesMichelangelo van Dam
 
Azure and OSS, a match made in heaven
Azure and OSS, a match made in heavenAzure and OSS, a match made in heaven
Azure and OSS, a match made in heavenMichelangelo van Dam
 
Zf2 how arrays will save your project
Zf2   how arrays will save your projectZf2   how arrays will save your project
Zf2 how arrays will save your projectMichelangelo van Dam
 
PHPUnit Episode iv.iii: Return of the tests
PHPUnit Episode iv.iii: Return of the testsPHPUnit Episode iv.iii: Return of the tests
PHPUnit Episode iv.iii: Return of the testsMichelangelo van Dam
 
Easily extend your existing php app with an api
Easily extend your existing php app with an apiEasily extend your existing php app with an api
Easily extend your existing php app with an apiMichelangelo van Dam
 

More from Michelangelo van Dam (20)

GDPR Art. 25 - Privacy by design and default
GDPR Art. 25 - Privacy by design and defaultGDPR Art. 25 - Privacy by design and default
GDPR Art. 25 - Privacy by design and default
 
Moving from app services to azure functions
Moving from app services to azure functionsMoving from app services to azure functions
Moving from app services to azure functions
 
Privacy by design
Privacy by designPrivacy by design
Privacy by design
 
DevOps or DevSecOps
DevOps or DevSecOpsDevOps or DevSecOps
DevOps or DevSecOps
 
Privacy by design
Privacy by designPrivacy by design
Privacy by design
 
Continuous deployment 2.0
Continuous deployment 2.0Continuous deployment 2.0
Continuous deployment 2.0
 
Let your tests drive your code
Let your tests drive your codeLet your tests drive your code
Let your tests drive your code
 
General Data Protection Regulation, a developer's story
General Data Protection Regulation, a developer's storyGeneral Data Protection Regulation, a developer's story
General Data Protection Regulation, a developer's story
 
Leveraging a distributed architecture to your advantage
Leveraging a distributed architecture to your advantageLeveraging a distributed architecture to your advantage
Leveraging a distributed architecture to your advantage
 
The road to php 7.1
The road to php 7.1The road to php 7.1
The road to php 7.1
 
Open source for a successful business
Open source for a successful businessOpen source for a successful business
Open source for a successful business
 
Decouple your framework now, thank me later
Decouple your framework now, thank me laterDecouple your framework now, thank me later
Decouple your framework now, thank me later
 
Deploy to azure in less then 15 minutes
Deploy to azure in less then 15 minutesDeploy to azure in less then 15 minutes
Deploy to azure in less then 15 minutes
 
Azure and OSS, a match made in heaven
Azure and OSS, a match made in heavenAzure and OSS, a match made in heaven
Azure and OSS, a match made in heaven
 
Getting hands dirty with php7
Getting hands dirty with php7Getting hands dirty with php7
Getting hands dirty with php7
 
Zf2 how arrays will save your project
Zf2   how arrays will save your projectZf2   how arrays will save your project
Zf2 how arrays will save your project
 
Create, test, secure, repeat
Create, test, secure, repeatCreate, test, secure, repeat
Create, test, secure, repeat
 
The Continuous PHP Pipeline
The Continuous PHP PipelineThe Continuous PHP Pipeline
The Continuous PHP Pipeline
 
PHPUnit Episode iv.iii: Return of the tests
PHPUnit Episode iv.iii: Return of the testsPHPUnit Episode iv.iii: Return of the tests
PHPUnit Episode iv.iii: Return of the tests
 
Easily extend your existing php app with an api
Easily extend your existing php app with an apiEasily extend your existing php app with an api
Easily extend your existing php app with an api
 

Recently uploaded

Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 

Recently uploaded (20)

Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 

Php Crash Course - Macq Electronique 2010

  • 1. PHP Crash Course Macq Electronique, Brussels 2010 Michelangelo van Dam
  • 2. Targeted audience experience with development languages knowledge about programming routines types and functions this is not “development for newbies” !
  • 3. Michelangelo van Dam • Independent Consultant • Zend Certified Engineer (ZCE) - PHP 4 & PHP 5 - Zend Framework • Co-Founder of PHPBenelux • Shepherd of “elephpant” herdes
  • 4. T AIL O RM A D E S O L U T I O N S Macq électronique, manufacturer and developer, proposes you a whole series of electronic and computing-processing solutions for industry, building and road traffic. Macq électronique has set itself two objectives which are essential for our company : developing with competence and innovation earning the confidence of our customers Macq électronique presents many references carried out the last few years which attest to its human and technical abilities to meet with the greatest efficiency the needs of its customers. For more information, please check out our website http://www.macqel.eu
  • 5. What is PHP ? • most popular language for dynamic web sites • open-source (part of popularity) •- pre-processed programming language no need to compile • simple to learn (low entry level) • easy to shoot yourself in your foot ! (no kidding)
  • 6. PHP is a “Ball of nails” “When I say that PHP is a ball of nails, basically, PHP is just this piece of shit that you just put together—put all the parts together—and you throw it against the wall and it fucking sticks.” Terry Chay
  • 7. History of PHP •- 1995: Rasmus Lerdorf created PHP for maintaining his own resume on the web - called it “Personal Home Page” - improved it with a Form interpreter (PHP-FI) • 1997: Zeev Zuraski and Andi Gutmans - rewrote first parser for PHP v3 - renamed it “PHP: Hypertext Preprocessor” • 1998: Zeev Zuraski and Andi Gutmans - redesigned the parser for PHP 4 (Zend Engine) - founded Zend Technologies, Inc.
  • 9. Seriously, who uses PHP ? “PHP is currently the most popular server-side web programming language. It runs 33,53%˙ of the websites on the Internet.” Source: wheel.troxo.com ˙ data from 2007 !!! PHP powers adult websites !!!
  • 10. Starting with PHP •- Minimum Requirements: php hypertext preprocessor (www.php.net) - a text editor (notepad, textpad, vi, pico, emacs, …) • Preferred requirements: - LAMP: Linux, Apache, MySQL, PHP - WAMP: Windows, Apache, MySQL, PHP - WIMP: Windows, IIS, MS SQL, PHP - SPAM: Solaris, PHP, Apache, MySQL - Mac OS X
  • 11. Where to start ? http://php.net
  • 13. My first PHP code Put the following code in file “helloWorld.php”: <?php echo 'Hello World'; ?> To execute this code you can just use user@server: $ /usr/local/zend/bin/php ./helloWorld.php And it will output Hello Worlduser@server: $
  • 15. Some dry theory first • Basic syntax • Exceptions • Types • References Explained • Variables • Predefined Variables • Constants • Predefined Exceptions • Expressions • Predefined Interfaces • Operators • Context options and • Control Structures parameters • Functions • Classes and Objects • Namespaces Same as on http://php.net/manual/en/langref.php
  • 16. Basic syntax • Escaping from HTML • Instruction separation • Comments
  • 17. Escape from HTML Simple escaping: <p>This is going to be ignored.</p> <?php echo 'While this is going to be parsed.'; ?> <p>This will also be ignored.</p> Advanced escaping: <?php if ($expression) { ?> <strong>This is true.</strong> <?php } else { ?> <strong>This is false.</strong> <?php } ?>
  • 18. Instruction separation <?php echo 'This is a test'; ?> <?php echo 'This is a test' ?> <?php echo 'We omitted the last closing tag';
  • 19. Comments <?php // single line comment if ($condition) { // another single line c++ style comment /* This is a multi-line comment that spans over multiple lines */ echo 'This is a test'; echo 'This is another test'; # with a single line shell style comment } A common mistake is to nest multi-line comments ! /* This multi-line comment /* has a nested multi-line comment spanning two lines */ */ The last */ will never be reached !!!
  • 20. Types • Booleans • Objects • Integers • Resources • Floating point • NULL numbers • Pseudo-types • Strings • Type Juggling • Arrays
  • 21. Scalar types • boolean (have a TRUE or FALSE state) •- integer (decimal, octal or hexadecimal) positive numbers (1,204, …) - negative numbers (-9, -128, …) - hexadecimal numbers (0x1A, 0xFF, …) - octal numbers (0123, 0777, …) • float (a.k.a. floats, doubles, real numbers) - 1.234, 1.2e3, 7E-10, … • string
  • 22. Single quoted strings <?php echo 'this is a simple string'; // this is a simple string echo 'this is a ' . 'combined string'; // this is a combined string echo 'this is a multi- // this is a multi-line string line string'; echo 'I'm an escaped character string'; // I'm an escaped character string $var = '[var]'; echo 'this $var is not processed'; // this $var is not processed
  • 23. Double quoted strings <?php echo "this is a simple string"; // this is a simple string echo "this is a " . "combined string"; // this is a combined string echo "this is a multi- // this is a multi-line string line string"; echo "I'm an escaped character string"; // I'm an escaped character string $var = '[var]'; echo "this $var is processed"; // this [var] is processed
  • 25. Arrays •- ordered map collection of keys and values ❖ keys: can only be an integer or a string ❖ values: can be of any type
  • 26. Example arrays $myArray = array (1, 2, 3, 4); // array[0] = 1; array[1] = 2; // array[2] = 3; $myArray = array (1, 'Hello World'); // array[0] = 1; // array[1] = 'Hello World'; $myArray = array (1 => 'a', 2 => 'b'); // array[1] = 'a'; array[2] = 'b'; $myArray = array ('a' => 1, 'b' => 2); // array['a'] = 1; array['b'] = 2; $myArray = array ( 'a' => array (1, 2, true), // array['a'] = array[0] = 1; // array[1] = 2; // array[2] = true; 'b' => array ( // array['b'] = 'a' = 1, // array['a'] = 1; 'b' = false, // array['b'] = false; 'c', // array[0] = 'c'; ), );
  • 27. Objects <?php class foo { function do_foo() { echo "Doing foo."; } } $bar = new foo; $bar->do_foo(); ?> Outputs Doing foo More about objects in the advanced PHP session…
  • 29. Resource •- Special type holds a reference to an external source ❖ a database, a file, a stream, … - can be used to verify a resource type
  • 30. NULL • represents a variable with no value •- a variable is considered null when assigned the NULL constant - it has no value assigned yet - has been emptied by unset()
  • 31. Pseudo Types • mixed: used for any type • number: used for integers and floats •- callback: a function (name) is used as parameter - a closure or anonymous function (as of PHP 5.3) - cannot be a language construct
  • 32. Type Juggling • no explicit type definitions of variables •- type of variable can change remember the shoot in the foot part ! • enforced type casting to validate types Confused yet ?
  • 33. Type Juggling example <?php $foo = "0"; // $foo is string (ASCII 48) $foo += 2; // $foo is now an integer (2) $foo = $foo + 1.3; // $foo is now a float (3.3) $foo = 5 + "10 Little Piggies"; // $foo is integer (15) $foo = 5 + "20 Small Pigs"; // $foo is integer (25) ?>
  • 34. Variables • Basics • Predefined variables • Variable scope • Variable variables
  • 35. Basics <?php $var = 'Bob'; $Var = 'Joe'; echo "$var, $Var"; // outputs "Bob, Joe" $4site = 'not yet'; // invalid; starts with a number $_4site = 'not yet'; // valid; starts with an underscore $täyte = 'mansikka'; // valid; 'ä' is (Extended) ASCII 228.
  • 37. Predefined Variables • Superglobals: are built-in variables (always available in all scopes) • $GLOBALS: References all variables available in global scope • $_SERVER: Server and execution environment information • $_GET: HTTP GET variables • $_POST: HTTP POST variables • $_FILES: HTTP File Upload variables • $_REQUEST: HTTP Request variables • $_SESSION: Session variables • $_ENV: Environment variables • $_COOKIE: HTTP Cookies • $php_errormsg: The previous error message • $HTTP_RAW_POST_DATA: Raw POST data • $http_response_header: HTTP response headers • $argc: The number of arguments passed to script • $argv: Array of arguments passed to script
  • 38. Variable Scope context in which a variable is defined <?php $a = 1; include ‘file.inc.php’; // $a is known inside the included script global scope <?php $a = 1; $b = 2; function foo() { global $a, $b; echo $b = $a + $b; } foo(); // outputs 3 echo $b; // outputs 3 ($b is known outside it’s scope)
  • 39. Variable Variables <?php $a = ‘php’; // value ‘php’ stored in $a $$a = ‘rules’; // value ‘rules’ stored in $$a (or $php) echo “$a ${$a}”; // outputs ‘php rules’ echo “$a $php”; // outputs ‘php rules’
  • 40. Constants • an identifier (name) for a simple value • that value cannot change • is case-sensitive by default • are always uppercase (by convention) •- 2 types basic - magic
  • 41. Basic Constants <?php define(‘CONSTANT’, ‘value’); define(‘KEY_ELEMENT’, 1); define(‘SYNTAX_CHECK’, true); echo CONSTANT // outputs ‘value’ echo Constant // outputs ‘Constant’ and issues a notice As of PHP 5.3 const CONSTANT = ‘value’; echo CONSTANT; // ouputs ‘value’
  • 42. Magic Constants • __LINE__: current line number of the file • __FILE__: full path and filename of the file • __DIR__: directory of the file • __FUNCTION__: function name (cs) • __CLASS__: class name (cs) • __METHOD__: class method name (cs) • __NAMESPACE__: current namespace (cs)
  • 43. Expressions $a = 5; function foo() { return ‘bar’; } 0 < $a ? true : false; $a = $b = 2; // both $a and $b have a value of 2 $c = ++$b; // $c has value 3 and $b has value 3 $d = $c++; // $d has value 3 and $c has value 4
  • 44. Operators • Operator Precedence • Arithmetic Operators • Assignment Operators • Bitwise Operators • Comparison Operators • Error Control Operators • Execution Operators • Incrementing/Decrementing Operators • Logical Operators • String Operators • Array Operators • Type Operators
  • 45. Control structures • if • declare • else • return • elseif/else if • require • while • include • do-while • require_once • for • include_once • foreach • goto • break • continue • switch
  • 46. Functions <?php function a($n){ b($n); return ($n * $n); } function b(&$n){ $n++; } echo a(5); //Outputs 36
  • 47. Next step: advanced PHP Classes and Objects Abstraction Security PHP Hidden Gems
  • 48. Recommended Reading CYAN YELLOW MAGENTA BLACK BOOKS FOR PROFESSIONALS BY PROFESSIONALS ® THE EXPERT’S VOICE® IN OPEN SOURCE Companion eBook Available PHP for Absolute Beginners PHP for Absolute Beginners Dear Reader, PHP for Absolute Beginners will take you from zero to full-speed with PHP pro- gramming in an easy-to-understand, practical manner. Rather than building PHP applications with no real-world use, this book teaches you PHP by walking you through the development of a blogging web site. You’ll start by creating a simple web-ready blog, then you'll learn how to add password-protected controls, support for multiple pages, the ability to upload and resize images, a user comment system, and finally, how to integrate with sites like Twitter. Along the way, you'll also learn a few advanced tricks including creating friendly URLs with .htaccess, using regular expressions, object-oriented pro- gramming, and more. I wrote this book to help you make the leap to PHP developer in hopes that you can put your valuable skills to work for your company, your clients, or on your own personal blog. The concepts in this book will leave you ready to take on the challenges of the new online world, all while having fun! PHP for Absolute Beginners for Absolute Beginners Jason Lengstorf THE APRESS ROADMAP Apress PHP Objects, Patterns, Pro PHP: PHP for and Practice Patterns, Frameworks, Absolute Beginners Testing, and More Beginning PHP Practical Web 2.0 and MySQL Applications with PHP Jason Lengstorf Everything you need to know to Beginning Ajax and PHP Companion eBook get started with PHP See last page for details on $10 eBook version Lengstorf SOURCE CODE ONLINE www.apress.com Jason Lengstorf US $34.99 Shelve in: PHP User level: Beginner this print for content only—size & color not accurate trim = 7.5" x 9.25" spine = 0.75" 408 page count
  • 49. Credits Ball of nails - Count Rushmore http://flickr.com/photos/countrushmore/2437899191 Life is too short for Java - Terry Chay http://flickr.com/photos/tychay/1388234558 Ruby Fails - IBSpoof (stickers by @spooons) http://www.flickr.com/photos/ibspoof/2879088241 Monkey Face - Mr Pins http://flickr.com/photos/7359188@N02/1358576877 Unicode Identifiers - Andrei Zmievski / Andrew Mager http://andrewmager.com/geeksessions-13-php-scalability-and-performance/ Confused - Kristian D. http://flickr.com/photos/kristiand/3223044657
  • 50. Questions ? Slides on SlideShare http://www.slideshare.net/DragonBe Give feedback ! http://joind.in/1256