H1 PHP basics

Syntax Anatomy of a PHP script Data types Variables Constants Operators Control structures Namespaces

H2 Functions

Basic Syntax Returning Values Variable Scope

H3 Strings and Patterns

Display an asterisk Variable interpolation Heredoc nowdoc syntax Escaping literal values Working with Strings Comparing, Searching and Replacing Strings Formatting Strings

H4 Array operations

H4 Array basics H4 Array operations H4 Array iteration H4 Sorting Arrays

H5 Web Programming

H5 Forms and urls

H6 Files, Streams, and Network Programming

H6.1 Reading files with file handles H6.2 Detecting end-of-file H6.3 Reading CSV files H6.4 Accessing network resources as files H6 Just some functions

H7 Database Programming

H8 Data Formats and Types

H8.1 JSON encoding/decoding H8.2 Dates and times H8.3 Extensible Markup Language H8.4 SimpleXML H8.5 DOM

H9 OO Programming in PHP

H9.1 OOP fundamentals H9.2 Class Methods and Properties H9.3 Constants, Statics en Props H9.4 Interfaces and Abstract classes

H10 Closures and Callbacks

H10.1 Closures H10.2 Callbacks

H11 Elements of OO Design

H11.1 Designing Codes H11.2 Design Pattern Theory H11.3 The Standard PHP Library H11.4 Generators

H12 Errors and Exceptions

Errors And Error management Exceptions

H13 Security

H14 Web Services

App A Array Functions

App B Filter Extension Filters and Flags

App C phpdbg

Chapter 8 Data Formats and Types - Paragraph paragraph Dates and Times

Listing 8.3: Datetime construction

When NewDate is called with the second param, then first date is calculated and then the second param is applied

Some datemethods: setDate, setISOdate, setTime, setTimestamp

Show a date in some format is always done with date->format

Handling Custom Formats

Listing 8.4: Comparing dates

DateTime Math

Listing 8.5: Working with intervals

Listing 8.6: Calculating date differences