PHP 7 Programming Cookbook
Tags
Summary
Editor's review
Who it's for
A good fit for
- 已掌握 PHP 基础语法、希望系统补齐面向对象与工程能力的中级开发者
- 需要在项目中落地表单验证、REST/SOAP 接口、路由与中间件的前后端工程师
- 想了解设计模式、算法基础与 Web 安全防护如何落在 PHP 代码里的技术人员
- 从 PHP 5 升级到 PHP 7 后,希望理解语言新特性差异与迁移要点的维护者
- 希望借 PSR-7 实现理解 PSR 规范与框架互操作原理的架构学习者
Not a good fit for
- 完全零基础、连变量、循环和 HTTP 请求都还不熟悉的编程新手
- 只想要一本与当前 PHP 8.x 最新特性完全同步的版本手册的读者
- 期待系统讲解前端框架、数据库运维或服务器部署的内容的运维与前端读者
Reading tips
- 先按第1章把 PHP 7、MySQL、PHPUnit 与自动加载环境搭起来,后续示例才能连贯跑通
- 把每章当作独立任务清单,边读边敲代码并提交到版本库,形成自己的代码片段库
- 阅读数据库、表单、Web 服务、中间件四章时,尝试把示例改造成自己项目中的一个小模块
- 注意版本差异:mcrypt、部分 PDO 与安全写法在 PHP 8 中已变化,动手前先查阅现行官方文档
About the publisher
The Publishing House of Electronics Industry is a comprehensive publisher distinguished by its focus on electronic information and related fields. Judging from the more than 3,000 titles in its catalogue, its publishing covers programming and design, artificial intelligence, computer science, finance and economics, photography, and social sciences, attending both to cutting-edge technology and to general readers. Representative titles include Factor Investing: Methods and Practice, x86 Assembly Language: From Real Mode to Protected Mode, The RISC-V Reader, Artificial Intelligence: Speech Recognition, Understanding and Practice, Phased Array Radar Technology, Radar Target Characteristics, and 100 Go Mistakes and How to Avoid Them, most of which centre on technical methods and engineering practice. Its authors include Shi Chuan, Li Zhong, Wang Xiaobo, David Patterson, Andrew Waterman, and Yu Zihao, among others from China and abroad. Owing to limited public information, no further publishing features are elaborated here.
Contents
- Chapter 1: Fundamentals
- Notes on Installing PHP 7
- Using the Built-in PHP Web Server
- Defining a MySQL Database for Testing / Installing PHPUnit / Implementing Class Autoloading
- Scanning a Website / Creating a Deep Web Scanner / Creating a Code Converter from PHP 5 to PHP 7
- Chapter 2: Effective Features in PHP 7
- Understanding the Abstract Syntax Tree / Understanding Differences in Parsing / Understanding Differences in foreach() Processing
- Using PHP 7 Enhancements to Improve Performance
- Iterating Over Files with Large Amounts of Data / Uploading Spreadsheets to a Database / Recursive Directory Iterator
- Chapter 3: Functional Programming Features in PHP
- Developing Functions / Hinting Data Types / Setting the Return Data Type of Functions
- Using Iterators / Writing Your Own Iterators with Generators
- Chapter 4: Object-Oriented Programming Features in PHP
- Developing Classes / Extending Classes / Using Static Properties and Methods / Using Namespaces
- Defining Visibility / Using Interfaces / Using Traits / Implementing Anonymous Classes
- Chapter 5: Interacting with Databases
- Connecting to a Database with PDO / Creating an OOP-Style SQL Statement Builder / Handling Pagination
- Defining Entities That Match Database Tables / Setting Entity Class Data Types to Match RDBMS Query Operations
- Embedding Secondary Queries in Query Results / Implementing PHP Queries for the jQuery DataTables Plugin
- Chapter 6: Creating Scalable Websites
- Creating a Generic Form Element Generator / Creating an HTML Radio Element Generator / Creating an HTML Select Element Generator
- Implementing a Form Factory / Associating $_POST Filters / Associating $_POST Validators / Associating Validation with Forms
- Chapter 7: Accessing Web Services
- Converting Between PHP and XML
- Creating a Simple REST Client / Creating a Simple REST Server
- Creating a Simple SOAP Client / Creating a Simple SOAP Server
- Chapter 8: Using date/time Data Types and Internationalization Features
- Using Emoticons or Emoji in View Scripts / Converting Complex Characters / Getting User Location from Browser Data
- Displaying Numbers in Appropriate Formats for the User's Location / Handling Currency Data / Formatting date/time Data Types
- Creating an HTML-Style Internationalized Calendar Generator / Creating a Recurring Event Generator
- Handling Translation Work Without the gettext Toolset
- Chapter 9: Developing Middleware
- Performing Validation Through Middleware / Implementing Access Control with Middleware / Improving Performance with Caching
- Implementing Routing / Implementing Interoperability Between Framework Systems / Implementing Cross-Language Functionality with Middleware
- Chapter 10: Advanced Algorithms
- Using Getters and Setters / Implementing a Linked List / Writing a Bubble Sort Program
- Implementing a Stack / Creating a Class That Implements Binary Search / Implementing a Search Engine / Displaying Multidimensional Arrays and Cumulative Totals
- Chapter 11: Implementing Various Software Design Patterns
- Creating an Array-to-Object Hydrator / Creating an Object-to-Array Hydrator
- Implementing the Strategy Pattern / Defining a Mapper / Implementing Object-Relational Mapping / Implementing the Publish/Subscribe Design Pattern
FAQ
这本书的原版英文书名是什么?
书里的代码现在还能直接运行吗?
零基础能直接读这本吗?
附录的 PSR-7 部分讲什么?
Comments
Find this book
This site is an index: you start “Search all sources” in your browser, and the entries it lists all point to third-party sites; please judge their availability yourself.