Solo Learning PHP Version 3Reading Notes

Web Technology Digital Transformation Artificial Intelligence Semantic Web Chatbot and Q&A User Interface Programming ICT Technology PHP and Web Development Navigation of this blog
Summary

PHP is a scripting language that runs on the server side and is primarily used for developing web applications. PHP was developed by Rasmus Lerdorf in 1995 and is currently developed and maintained by the open source community.

PHP is widely used to generate dynamic web pages, manipulate databases, upload and download files, and other functions. Since PHP can be embedded in HTML, it can also be used to execute PHP scripts directly within web pages. It is also widely used as a framework for popular web applications such as WordPress, Joomla, Drupal, etc., because it can run on many operating systems and is easily integrated with many databases and web servers, It is recognized as a language suitable for web application development because it can run on many operating systems and is easy to integrate with many databases and web servers.

In recent years, the language has been enhanced with object-oriented syntax, type declarations, standard libraries, and application frameworks, making it suitable for large-scale development. In addition, support for PHP is being strengthened mainly on Microsoft Azure, a cloud environment, and PHP, which previously seemed to be a technology mainly for the Linux environment, can now be used under a multi-platform environment.

This article is based on the “Self-study PHP 3rd edition” (4th edition is now published).

In this article, I will discuss the reading notes.

Solo Learning PHP Version 3Reading Notes

Chapter 1 Introduction
1.1 PHP and Web Applications
1.1.1 Client/Server Communication
1.1.2 Static and dynamic pages
1.1.3 Client-Side and Server-Side Technologies
1.2 Position of PHP in Server-Side Technology
1.3 Procedures for Setting Up a PHP Environment
1.3.1 Required Software for PHP Programming
1.3.2 Environment Setup Procedure with XAMPP
1.3.3 Preparation for Sample Execution
Check your understanding of this chapter
Chapter 2: PHP Basics
2.1 Basic PHP Syntax
2.1.1 The basic extension is “.php
2.1.2 Character Code Settings
2.1.3 PHP is an interpreted language
2.1.4 PHP is an HTML-embedded language
2.1.5 Semicolons (;) separate sentences
2.1.6 Case Insensitive
2.1.7 Comments are a reminder for developers
2.2 Variables
2.2.1 “Declaration” of Variables
2.2.2 Variable Naming Conventions
2.2.3 Supplementary Variables
2.3 Constants
2.3.1 Basics of Constants
2.3.2 Predefined Constants
2.4 Data Types
2.4.1 Logical literals (bool)
2.4.2 Integer literals (int)
2.4.3 Floating-point literals (float)
2.4.4 String Literals
2.4.5 Difference between Single-quoted and Double-quoted Strings
2.4.6 Heard Documents
2.4.7 Null
2.5 Arrays
2.5.1 Array Basics
2.5.2 Checking the Contents of Supplemental Arrays
2.5.3 Basics of Associative Arrays
2.5.4 Multidimensional Arrays
2.5.5 Relationship between Supplementary Normal Arrays and Associative Arrays
2.6 Type Mutual Conversion
2.6.1 Implicit conversions
2.6.2 Explicit conversion (cast)
2.6.3 Supplemental String-to-Number Type Casting
Check your understanding of this chapter
Chapter 3 Operators
3.1 Algebraic Operators
3.1.1 Mixed String Operations
3.1.2 Adders (++)/ Subtracters (+)
3.1.3 Magical Increments
3.1.4 Be careful with floating point number operations
3.1.5 Array Combining
3.2 Assignment Operators
3.2.1 Assignment by value and assignment by reference
3.3 Comparison Operators
3.3.1 Mixed String Comparisons
3.3.2 Strict equivalence operator (===)
3.3.3 Comparison of Floating-Point Numbers
3.3.4 Array Comparison
3.3.5 Conditional operator (?) :}
3.4 Logical operators
3.4.1 Shortcut operations (short-circuit operations)
3.5 Bitwise Operators
3.5.1 Bitwise logical operators
3.5.2 Bit shift operation
3.6 Other Operators
3.6.1 String Operators
3.6.2 Execution operators
3.6.3 Error control operators
3.7 Operator Precedence and Binding Rules
3.7.1 Precedence
3.7.2 Combining rules
Check your understanding of this chapter
Chapter 4 Control Syntax
4.1 Conditional Branches
4.1.1 if Instruction─Simple Branching
4.1.2 if Instruction─Multiple Branches
4.1.3 if Instructions─Nested Structures
4.1.4 Supplemental curly braces are optional
4.1.5 switch instruction─Multiple branches
4.1.6 Supplemental switch instruction decision method
4.2 Iteration
4.2.1 while/do to while instructions
4.2.2 Supplemental Infinite Loop
4.2.3 for Instruction
4.2.4 Supplementary Comma Operators
4.2.5 foreach instruction
4.2.6 Passing by Reference of Value Variables
4.3 Loop Control
4.3.1 Break Instruction
4.3.2 continue Instruction
4.3.3 Loop Nesting and Break/Continue Instructions
4.3.4 Continue Instruction with Supplemental Switch Instruction
4.4 Other Topics of Control Instructions
4.4.1 goto Instruction
4.4.2 Script Blocks and Fixed Templates
4.4.3 Alternative syntax for supplementary control instructions
Check your understanding of this chapter
Chapter 5 Built-in Functions
5.1 Function Basics
5.1.1 Function Calls
5.1.2 Built-in Functions
5.1.3 Syntax Notation
5.2 String Functions
5.2.1 Obtaining the Length of a String ─ ─ mb_strlen Function
5.2.2 Converting a string from upper case to lower case ── strtolower/strtoupper functions
5.2.3 Obtaining a substring ── mb_substr function
5.2.4 Replacing a substring ── str_replace function
5.2.5 Splitting a String at a Specific Delimiter ──explode Function
5.2.6 Searching for a Specific Character Position ── mb_strpos/mb_strrpos Functions
5.2.7 Formatting Strings ──printf Function
5.2.8 Converting Strings ── mb_convert_kana Function
5.2.9 Converting Character Encoding – mb_convert_encoding/ mb_convert_variables
5.2.10 Sending E-Mail ─ ─ mb_send_mail Function
5.3 Array Functions
5.3.1 Obtaining the number of elements in an array ──count function
5.3.2 Concatenating Array Contents ──array_merge Function
5.3.3 Combining Array Elements ──implode Function
5.3.4 Add/Remove elements at the beginning/end of an array ──array_push/array_pop/array_shift/array_unshift functions
5.3.5 Supplementary Stacks and Queues
5.3.6 Adding/Replacing/Deleting Multiple Elements in an Array ──array_splice Function
5.3.7 Retrieving a Specific Range of Elements from an Array ──array_slice Function
5.3.8 Searching the Contents of an Array ──array_search Function
5.3.9 Checking whether a specific element exists in an array ── in_array function
5.3.10 Sorting Array Contents ── sort function
5.3.11 Sorting Arrays by Your Own Rules ─ ─ usort Function
5.4 Regular Expression (PCRE) Functions
5.4.1 Regular Expression Basics
5.4.2 Regular Expression Functions to be used
5.4.3 Searching for a string with a regular expression ──preg_match function
5.4.4 Get all match strings ── preg_match_all function
5.4.5 Replacing a string with a regular expression ──preg_replace function
5.4.6 Regular Expression Patterns for Supplementary URL Strings
5.4.7 Splitting a string with a regular expression ── preg_split function
5.4.8 Regular Expression Pattern Qualifiers
5.5 File System Functions
5.5.1 Example 1 Writing to a text file
5.5.2 Opening a file──fopen/fclose functions
5.5.3 Error Handling in fopen Function ─ Error Control Operators
5.5.4 Writing to a File ── fwrite Function
5.5.5 Locking the File ─ ─ flock Function
5.5.6 Example 2 Reading tab-delimited text ──fgetcsv function
5.5.7 Example 3 Reading tab-delimited text (alternative solution)──fgets/file function
5.5.8 Setting Parameters for File System Functions
5.6 Other Functions
5.6.1 Mathematical functions
5.6.2 Discarding a variable ──unset function
5.6.3 Determining the data type of a variable ──is_xxxxxxx function
Check your understanding of this chapter
Chapter 6 User-defined Functions
6.1 What is a user-defined function?
6.1.1 Basics of User-defined Functions
6.1.2 Argument/Return Value Type Declaration 7.0
6.1.3 Script Externalization
6.1.4 Position to define supplementary functions
6.2 Valid Scope of Variables
6.2.1 Global and Local Variables
6.2.2 Using global variables in functions ──global instruction
6.2.3 Static variable──static instruction
6.2.4 Scope of Include Files
6.2.5 Supplemental unset function behavior
6.3 Various Notations for Arguments
6.3.1 Default values for arguments
6.3.2 Passing by Reference of Arguments
6.3.3 Functions with variable length arguments5.6
6.3.4 Example 1 Mixing variable-length and regular arguments
6.3.5 “…” Unpacking Arguments with Operators
6.4 Function Calls and Return Values
6.4.1 Multiple Return Values
6.4.2 Recursive Functions
6.4.3 Variable functions
6.4.4 Anonymous Functions (Closures)
6.4.5 Inheriting Variables of Parent Scope ──use Instruction
6.5 Generators
6.5.1 Example 2 Generator for finding prime numbers
6.5.2 Getting Generator Results 7.0
6.5.3 Delegate some processing to other generators7.0
Check your understanding of this chapter
Chapter 7 Standard Class Libraries
7.1 Basics of Object-Oriented Programming
7.1.1 Classes and Functions/Variables
7.1.2 Relationship between classes and objects
7.1.3 Instantiation and Member Calls
7.1.4 Static Properties/Static Methods
7.2 DateTime Class
7.2.1 Creation of DateTime Objects
7.2.2 Formatting date/time values in a specified format ──format method
7.2.3 Parsing a date/time string ─ ─ createFromFormat method
7.2.4 Adding/Subtracting Date/Time Values ─ ─ add/sub method
7.2.5 Obtaining the difference between date/time values ──diff method
7.2.6 Supplemental Date/Time Functions
7.3 DirectoryIterator Class
7.3.1 Opening Folders
7.3.2 Retrieve elements under a folder in order
7.3.3 Obtaining File Information
7.4 Utilization of External Libraries──Composer
7.4.1 Installation of Composer
7.4.2 Main commands available in Composer
7.5 Smarty template engine
7.5.1 Example Template Engine Basics
7.5.2 Supplemental Smarty Extended Setup
7.5.3 Components of a template
Check your understanding of this chapter
Chapter 8 Request Information
8.1 Request Information
8.1.1 Confirmation of HTTP communication
8.1.2 HTTP Methods and HTTP Status
8.1.3 Super global variables
8.2 Post data─$_POST
8.2.1 Example 1Getting post data
8.2.2 Necessity of Escape Processing
8.2.3 Example 2 Accessing multi-valued elements
8.3 Query Information──$_GET
8.3.1 Example 3Get query information
8.3.2 Example 4 Passing values via hyperlink
8.3.3 Post Data and Query Information
8.4 Header Information──$_SERVER
8.4.1 Types of Header Information
8.4.2 Usage of Header Information
8.4.3 Example 5Getting Request Headers
8.4.4 Setting Supplementary Response Headers (1) ── Redirect
8.4.5 Setting Supplementary Response Headers (2) ── Other Uses
8.5 Server Environment Variables─$_ENV
8.6 Cookie information─$_COOKIE
8.6.1 Example 6 Basic reading and writing of cookies
8.6.2 Mechanism of Cookie Transfer
8.7 Session Information─$_SESSION
8.7.1 Example 7 Reading and writing basic session information
8.7.2 Session Mechanism
8.7.3 Destroying a Session
8.7.4 Session Settings
8.8 Implementation of Upload Process──$_FILES
8.8.1 Example 8 Uploading an Image File
8.8.2 Notes on Input Forms
8.8.3 Actual Upload Processing
8.8.4 Upload Error Handling
8.8.5 Configuration parameters related to upload
Check your understanding of this chapter Translated with www.DeepL.com/Translator (free version)
Chapter 9 Database Linkage
9.1 Database Types
9.1.1 Types of Relational Databases
9.2 Basics of Database Operations
9.2.1 Using MariaDBmonitor
9.2.2 SQL Basics
9.3 Database Abstraction Layer
9.3.1 PDO (PHPDataObjects)
9.4 Connecting to the Database
9.4.1 Connecting and Disconnecting
9.4.2 Basics of Exception Handling ── try~catch~finally instruction
9.4.3 Externalization of Connection Scripts
9.4.4 Connection Options
9.5 Issuing SQL Queries
9.5.1 Registering in the Database Based on Example Input Values
9.5.2 Named and unnamed parameters
9.5.3 Obtaining an auto-increment value
9.6 Retrieving Result Sets
9.6.1 Fetching Methods
9.6.2 Fetch Mode
9.7 Binding of Parameter Values
9.7.1 Declaring the Data Type of Parameters ─ Manipulating Binary Data
9.7.2 bindValue and bindParam methods
9.8 Transaction Processing
9.8.1 Utilizing Transactions
Check your understanding of this chapter
Chapter 10 Object-Oriented Syntax
10.1 Class Definition
10.1.1 The simplest class
10.1.2 Properties
10.1.3 Methods
10.1.4 Constructors
10.1.5 Destructors
10.1.6 Static Methods
10.1.7 Static Properties
10.1.8 Class constants
10.2 Encapsulation
10.2.1 Access modifiers
10.2.2 Accessor Methods
10.3 Inheritance
10.3.1 Basics of inheritance
10.3.2 Overriding Methods
10.3.3 Calling Superclass Methods ──Parent Keyword (1)
10.3.4 Calling the constructor of a superclass ─ parent keyword (2)
10.3.5 Prohibition of Override──final modifier
10.4 Polymorphism
10.4.1 Abstract Methods
10.4.2 Interfaces
10.4.3 instanceof operator
10.4.4 Unnamed Class 7.0
10.5 Traits
10.5.1 Trait Basics
10.5.2 Traits and Multiple Inheritance
10.5.3 Example 1 Accessor Method Implementation
10.5.4 Behavior in case of name conflict
10.6 Object Manipulation
10.6.1 Object Assignment
10.6.2 Comparing Objects
10.6.3 Iterating over objects
10.6.4 Customizing Example 2 Iteration
10.7 Exception Handling
10.7.1 Throwing Exceptions──throw instruction
10.7.2 Extending the Exception Class
10.7.3 Handling Error Reports
10.8 Magic Methods
10.8.1 Handling Undefined Properties (1) ─__get/__set methods
10.8.2 Handling Undefined Properties (2) ─__isset/__unset methods
10.8.3 Handling Undefined Methods ─__call/__callStatic Methods
10.8.4 Specifying the string representation of an object ──__toString method
10.8.5 Executing an object as a function ─__invoke method
10.8.6 Customizing how objects are cloned ─__clone method
10.8.7 Customizing Debugging Information ─__debugInfo method 5.6
10.9 Namespace
10.9.1 Namespace Basics
10.9.2 Name Notation and Name Resolution Rules
10.9.3 Importing
10.10 Automatic Class Loading
10.10.1 spl_autoload_register Function
10.10.2 Example 3 Namespace-aware Autoloader
10.10.3 Automatic invocation of spl_autoload_register function
Check your understanding of this chapter
Chapter 11 Security Measures
11.1 Cross-site Scripting
11.1.1 Causes
11.1.2 Countermeasures
11.1.3 Allowing Supplemental Tag Strings
11.2 SQL Injection
11.2.1 Causes
11.2.2 Countermeasures
11.2.3 Supplemental OS Command Injection
11.3 Cross Site Request Forgery
11.3.1 Causes
11.3.2 Countermeasures
11.4 Path traversal
11.4.1 Causes
11.4.2 Countermeasures
11.4.3 Supplemental null byte attack
11.5 Mail Header Injection
11.5.1 Causes
11.5.2 Countermeasures
11.6 Other attacks and preventive measures
11.6.1 Session hijacking
11.6.2 File upload attacks
11.6.3 eval attacks
11.6.4 Include attacks
11.6.5 Prevention with Supplemental php.ini
11.7 Input Value Validation
11.7.1 Assumptions for verification
11.7.2 Example Input Form Validation Process
Check your understanding of this chapter
Appendix A “Exercises” and “Check Your Understanding of This Chapter” Answers Translated with www.DeepL.com/Translator (free version)

コメント

タイトルとURLをコピーしました