Introduction to PHP 5 Programming
Duration: 3 Days
Intended Audience and Prerequisites
The course is aimed at Programmers who need will be writing, or maintaining PHP scripts. It is designed to be a stepping stone to more advanced PHP web application development courses. Programming experience with some other language as well as a basic understanding of HTML is useful.
Synopsis
The course will be taught on a Linux system running Apache. However, if required the course can also be taught on platforms running Microsoft Windows or MacOSX. The course will also provide an introduction to PHP programming using the Zend Studio IDE. The course itself will focus on the programming language aspects of PHP. It will cover the usual features expected in a programming language,namely
- Declaration and initialisation of variables
- Construction of expressions using arithmetic, logical and relational operators
- Loops and iteration
- Conditional statements
- Reading/writing of text and binary files
- Manipulating text using regular expression
- Usage and coding of functions
- Usage of the built-in library functions
- Working with arrays and hashes
- Creating and using external PHP Code
Contents:
- History and Overview of PHP
- Installing PHP
- General Requirements
- Linux and MacOSX based Systems
- Windows based Systems
- Zend Studio - Integrated Development Environment (IDE)
- Overview of PHP Language Basics and Context
- Programming Fundamental Concepts
- Comment markers
- PHP Tags
- Output Commands
- Using STDIN STDOUT and STDERR
- Using Files
- Include_path
- Opening files
- Reading files
- Writing to Files
- RTRIM
- PHP Variables
- Naming Rules
- Data Types
- Numerical
- Integer
- Floating Point Numbers
- Floating Point Precision
- Single Quoted Strings
- Double Quoted Strings
- Creating and Assigning Variables
- Assigning Values to Variables
- Type Conversion
- Variable Scoping
- Global Keyword
- Static Keyword
- Super Globals
- Constants
- Variable Variables
- Operators
- Assignment Operators
- Increment/Decrement Operators
- Arithmetic Operators
- String Operators
- Comparison Operators
- Logical Operators
- Control Structures
- Statement Blocks
- If Construct
- Else Keyword
- Elseif Keyword
- Looping Constructs
- While Loop
- Do-while Loop
- For Loop
- Foreach Loop
- Loop Control Words
- Break
- Continue
- Regular Expressions
- Meta-Characters
- Backslash
- Unicode Character Properties
- Circumflex and Dollar
- Full Stop
- Square Brackets
- Vertical Bar
- Multipliers
- Subpatterns
- Repetition
- Pattern Matching with ereg and eregi
- Pattern Matching with preg_match
- Splitting Text
- Switch
- PHP Arrays
- Syntax
- Creating/Modifying arrays - using the Square-Bracket Syntax
- Array Functions
- Avoiding bugs when working with Arrays
- Using a Return value as a Key
- Strings and Arrays
- Sorting an Array
- Multi-Dimensional Arrays
- PHP Functions
- Conditionally Created Functions
- Functions Created Inside Functions
- Passing Arguments by Value
- Passing Arguments by Reference
- Returning Values
- Including External PHP Functions
- Introduction to Object Oriented PHP Programming
- Classes and Inheritance
- Classes
- Inheritance
- Keywords
- PHP and PEAR
- What is PEAR?
- Command Line Package Installer
- Fully-Automatic Installation
- Semi-Automatic Installation
- What is PECL?
- PHP and HTML
- Basic HTML/PHP Examples