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 JSON encoding data

Listing 8.1: JSON options

Try removing any of the parameters, or $options from the call. Or the key from the data which might return a array, if JSON_FORCE_OBJECT is not set:

Try removing any of the parameters:

Listing 8.2: Implementing JsonSerializable

Chapter 8 Data Formats and Types - Paragraph paragraph JSON decoding data

Decode into an object or into an array.