PHP Modules Tutorials - Herong's Tutorial Examples

https://www.herongyang.com/PHP-Modules

© 2003-2026 Herong Yang. All rights reserved.

PHP Modules Tutorials This PHP tutorial book is a collection of notes and sample codes written by the author while he was learning PHP modules himself. Topics include running PHP scripts on Windows, macOS and Linux; cURL module for getting URL responses; DOM mudule for parsing HTML Documents; GD module for processing image files; MySQLi module for MySQL database server access; OpenSSL module for cryptographic operations; PCRE module for regular expression operations; SOAP module for using SOAP Web services. Zip module for managing ZIP archives; Updated in 2026 (Version v5.19) with minor changes.

Table of Contents

About This Book

Introduction and Installation of PHP

What Is PHP

Downloading and Installing PHP 7.3 for Windows

"php -help" - Command Line Options

"php -m" - Built-in Modules

Hello.php - My First PHP Script

"php -a" - PHP Interactive Shell

Downloading and Installing PHP Documentation

Managing PHP Environment and Modules on macOS

PHP Version Pre-Installed on macOS

Upgrade PHP Environment on macOS

Managing PHP Environment and Modules on CentOS

PHP Version Pre-Installed on CentOS

Install PHP Extensions on CentOS

PHP Version Pre-Installed on CentOS 6

Use PHP Composer on CentOS Computers

Configuration and Modules

Manage Runtime Configuration Directives

"php -i" - Display Configuration Information

php.ini - Configuration Directive File

Additional .ini Configuration Files

Load PHP Extensions/Modules

extension_dir - Module Library Location

"php -m" - Display Loaded Modules

get_extension_funcs() - Get Module Functions

dl() - Load Module Dynamically

cURL Module - Client for URL

DOM Module - Parsing HTML Documents

DOM (Document Object Model) Module

Parse and Traverse HTML Documents

Build New HTML Documents

Load HTML Documents with LIBXML_NOBLANKS

Remove Whitespaces in HTML Documents

DOCTYPE Element in HTML Documents

Remove Dummy Elements in HTML Documents

Install DOM Extension on CentOS

GD Module - Manipulating Images and Pictures

GD Library of Image Functions

GD Library - Draw Graphical Elements

GD Library - Print 2 Pictures on 1 Page

GD Library - Create Transparent Image

Transparent Image Over Text Web Page

GD Library - Pad Transparent Image

MySQLi Module - Accessing MySQL Server

MySQLi Module and Configuration

mysqli-hello.php - Test MySQLi Module

mysqli_connect() - Open MySQL Connection

mysqli_query() - Run SQL Queries

mysqli_affected_rows() - Count Affected Rows

mysqli_insert_id() - ID from AUTO_INCREMENT

mysqli_fetch_array() - Fetch Row from Query Result

mysqli_fetch_fields() - Fetch Field Information

Escape Escape Characters - \\\\ for \\

Summary of Basic MySQLi Functions

MySQLi Object-Oriented Programming

OpenSSL Module - Cryptography and SSL/TLS Toolkit

PCRE Module - Perl Compatible Regular Expressions

PCRE Module and C Library

preg_match() - Regular Expression Match

preg_grep() - Search Array Members

preg_replace() - Replace Matched Substring

preg_split() - Split String into Tokens

preg_quote() - Escape Characters in Pattern

SOAP Module - Creating and Calling Web Services

SOAP Module and PHP Implementations of SOAP

Turning on the Default SOAP Module

Hello_There.php - First Example of SOAP

SoapClient - SOAP Client Class and Functions

Hello_There_Dump.php - Debugging SOAP Messages

What Is WSDL

Using SOAP Extension in non-WSDL Mode

SOAP Module - Server Functions and Examples

Zip Module - Managing ZIP Archive Files

The ZipArchive Class

Create New ZIP Archive

Extract Files from ZIP Archive

Create ZIP Archive with Directory

Create ZIP Archive for Download

References

Index

Full Version in PDF/EPUB

Keywords: PHP, Tutorial, Examples, Web