PHP Modules Tutorials - Herong's Tutorial Examples - v5.19, by Herong Yang
PHP Modules Tutorials - Herong's Tutorial Examples
https://www.herongyang.com/PHP-Modules
© 2003-2026 Herong Yang. All rights reserved.
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
Introduction and Installation of PHP
Downloading and Installing PHP 7.3 for Windows
"php -help" - Command Line Options
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
Manage Runtime Configuration Directives
"php -i" - Display Configuration Information
php.ini - Configuration Directive File
Additional .ini Configuration Files
extension_dir - Module Library Location
"php -m" - Display Loaded Modules
get_extension_funcs() - Get Module Functions
dl() - Load Module Dynamically
DOM Module - Parsing HTML Documents
DOM (Document Object Model) Module
Parse and Traverse 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 - 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
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
Using SOAP Extension in non-WSDL Mode
SOAP Module - Server Functions and Examples
Zip Module - Managing ZIP Archive Files
Extract Files from ZIP Archive
Create ZIP Archive with Directory
Keywords: PHP, Tutorial, Examples, Web