PHP Tutorials - Herong's Tutorial Examples - v5.18, by Herong Yang
PHP Tutorials - Herong's Tutorial Examples
https://www.herongyang.com/PHP
© 2003-2024 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 himself. Topics include PHP script syntax; data types, variables, array, expressions, statements and functions; Web server integration; HTTP requests and controlling HTTP responses; sessions, cookies, and file uploads/downloads; files, directories; classes and objects; using PHP on Windows, macOS and Linux; executing external programs on operating system. Updated in 2024 (Version v5.18) with minor changes.
Table of Contents
Introduction and Installation of PHP
Downloading and Installing PHP 7.3 for Windows
"php -help" - Command Line Options
"php -i" - PHP Engine Information
php.ini - PHP Runtime Configuration
Hello.php - My First PHP Script
"php -a" - PHP Interactive Shell
Downloading and Installing PHP Documentation
PHP Script Source Code File Format
PHP Statement Delimiter and Comments
PHP Data Types and Data Literals
Data Literals Supported in PHP
Data Literals Examples for Integer, String and Other Data Types
Overflow of Integer and Float Values
Variables, References, and Constants
Variables and Assignment Operations
Variable Variable Name - Name Variables with Expressions
Constant and define() Function
Expressions, Operations and Type Conversions
Data Type Automatic Conversion
Conditional Statements - "if" and "switch"
Loop Statements - "while", "for", and "do ... while"
"break" and "continue" Statements
Function Declaration, Arguments, and Return Values
Array Related Built-in Functions
Usage Examples of Array Functions
Interface with Operating System
$argv[] - Command Line Arguments
Options to Execute External Programs
exec() - Execute External Programs
system() - Execute External Programs
passthru() - Execute External Programs
popen() - Execute External Programs
proc_open() - Execute External Programs
memory_get_usage() - Memory Usage Info
set_time_limit() - max_execution_time
Introduction of Class and Object
What Is a Superclass and a Subclass
What Is an Overloaded Property
What Is Object Property Iteration
Updating Variables Who Share an Object
Passing Objects as Function Arguments
Integrating PHP with Apache Web Server
Downloading Apache 2.4.37 Binary for Windows
Installing Apache 2.4.37 on Windows Systems
Publishing HTML Documents as Web Pages
Starting and Stopping Apache Server
Configuring Apache for PHP CGI Scripts
Publishing PHP Scripts as Web Pages
Permission Error on php-cgi.exe
Configuring Apache PHP Load Module
Retrieving Information from HTTP Requests
Predefined Variables Related to HTTP Requests
Operating System Information in $_SERVER
Web Server Information in $_SERVER
Information in $_GET and $_REQUEST
Registering $_REQUEST Keys as Global Variables
Creating and Managing Sessions in PHP Scripts
How Sessions Are Supported in PHP
SessionPage*.php - Session Test Script Pages
Running Session Test Script Pages
Managing Session IDs without Cookies
Sending and Receiving Cookies in PHP Scripts
Sending and Receiving Cookies - Example
ob_start() - Output Buffering Function
Persistent Cookies Saved on Hard Disk
Other Cookie Properties - Domain and Path
Controlling HTTP Response Header Lines in PHP Scripts
Functions to Manage Directories, Files and Images
opendir() and Directory Management Functions
file_exists() and File Testing Functions
FileExistsTest.php - File Testing Examples
fopen() and File Input/Output Functions
File_Input_Output_Test.php - File Input/Output Examples
readfile() and Special File Handling Functions
ShowPhoto.php - Simple Slid Show Script
Localization Overview of Web Applications
What Is Localization / Internationalization
Localization of Web Based Applications
Character String Traveling Paths
Output ASCII Character Strings from PHP Scripts
Using Non-ASCII Characters in HTML Documents
Basic Rules of Using Non-ASCII Characters in HTML Documents
French Characters in HTML Documents - UTF-8 Encoding
French Characters in HTML Documents - ISO-8859-1 Encoding
Chinese Characters in HTML Documents - UTF-8 Encoding
Chinese Characters in HTML Documents - GB2312 Encoding
Characters of Multiple Languages in HTML Documents
Using Non-ASCII Characters as PHP Script String Literals
Basic Rules of Using Non-ASCII Characters in HTML Documents
French Characters in String Literals - UTF-8 Encoding
French Characters in HTML Documents - ISO-8859-1 Encoding
Chinese Characters in String Literals - UTF-8 Encoding
Chinese Characters in String Literals - GB2312 Encoding
Characters of Multiple Languages in String Literals
Receiving Non-ASCII Characters from Input Forms
Basic Rules of Receiving Non-ASCII Characters from Input Forms
Receiving Non-ASCII Characters with GET Method
Receiving Non-ASCII Characters with POST Method
Receiving Non ASCII Characters in UTF-8 Encoding
"mbstring" Extension and Non-ASCII Encoding Management
Managing Non-ASCII Character Strings with MySQL Servers
Storing Non-ASCII Characters in Database
Transmitting Non-ASCII Characters with Database
MySqlUnicode.php - MySQL Unicode UTF-8 Encoding Example
Configuring and Sending Out Emails
Using Local Windows System as a Mail Server
Sending Out Emails from PHP Scripts
Sending Out Emails on Linux Systems
Install PHPMailer on CentOS Systems
Send Local Emails with PHPMailer
Send Remote Emails with PHPMailer
Use SMTPS Protocol with PHPMailer
Install PHPMailer from Source Code
Managing PHP Engine and Modules on macOS
PHP Version Pre-Installed on macOS
Managing PHP Engine 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
Archived: Downloading and Installing PHP 7.0 for Windows
Archived: Downloading and Installing PHP 5.6.6 for Windows
Archived: Downloading and Installing PHP 5.4.3 for Windows
Archived: Downloading and Installing PHP 5.2.2 for Windows
Archived: Downloading and Installing PHP 5.0.4 for Windows
Archived: Adding PHP to IIS as CGI
Archived: Downloading Apache HTTP Server 2.4.12 for Windows
Archived: Installing Apache HTTP Server 2.4.12 on Windows
Archived: Publishing PHP Scripts as Web Pages
Archived: Configuration for php_mysql.dll Library
Archived: mysql_connect() using php_mysql.dll Library
Archived: MySqlLoop.php using php_mysql.dll Library
Archived: Get_Temperature.php - First Example of SOAP
Archived: Get_Temperature_Dump.php - Dumping Debugging Information
Keywords: PHP, Tutorial, Examples, Web