Why is PHP the most widely used programming language on the web? This updated edition teaches everything you need to know to create effective web applications using the latest features in PHP 7.4. You’ll start with the big picture and then dive into language syntax, programming techniques, and other details, using examples that illustrate both correct usage and common idioms.
If you have a working knowledge of HTML, authors Kevin Tatroe and Peter MacIntyre provide many style tips and practical programming advice in a clear and concise manner to help you become a top-notch PHP programmer.
• Understand what’s possible when you use PHP programs
• Learn language fundamentals, including data types, variables, operators, and flow control statements
• Explore functions, strings, arrays, and objects
• Apply common web application techniques, such as form processing, data validation, session tracking, and cookies
• Interact with relational databases like MySQL or NoSQL databases such as MongoDB
• Generate dynamic images, create PDF files, and parse XML files
• Learn secure scripts, error handling, performance tuning, and other advanced topics
• Get a quick reference to PHP core functions and standard extensions
AI Reading Assistant
Whole-book reading guide from stratified index samples; jump to passages in the text
Tip the Site
Support this siteYour recognition and a small knowledge-service contribution help keep this technical work open source.Scan the WeChat Pay or Alipay code below. Logged-in and guest visitors can both tip.
WeChat Pay
Alipay
Open WeChat or Alipay and scan. No login required.
AI guide
【One-Line Pitch】
This is the definitive, practical guide to PHP 7.4 for anyone with basic HTML knowledge who wants to build dynamic, database-driven web applications, covering everything from language syntax to advanced topics like security and performance tuning.
【Book Arc】
- **Opening (~0%–9%)**: Introduces PHP's history, its role in web development, and the core language fundamentals—data types, variables, operators, and basic flow-control statements—establishing the syntax foundation for all subsequent chapters.
- **Early (~9%–28%)**: Delves deeper into language mechanics, covering implicit casting, arithmetic and comparison operators, auto-increment/decrement, and the full suite of flow-control constructs (if, switch, while, for, foreach, try...catch, declare), plus how to embed PHP in HTML and include external code files.
- **Early (~28%–38%)**: Focuses on functions—defining them, passing arguments, returning values (including by reference), and using variable functions—along with practical idioms for code organization and reuse.
- **Middle (~38%–53%)**: Explores strings and arrays in depth, including concatenation, printf()/sscanf() formatting, string-searching functions, regular expressions (with greedy vs. nongreedy quantifiers), and array manipulation techniques for keys and values.
- **Middle (~53%–End)**: Applies the fundamentals to real-world web scenarios, covering form processing, data validation, sessions, cookies, database interaction (MySQL and NoSQL), and advanced topics like secure scripting, error handling, and performance tuning.
【Key Takeaways】
- **PHP is a pragmatic, web-first language** (Opening): Its design prioritizes ease of embedding in HTML and rapid development over strict purity, making it accessible to beginners while powerful enough for complex applications.
- **Master the operator zoo** (Early): Understanding the nuances of auto-increment/decrement (pre vs. post), comparison (including strict ===), and logical operators is critical for writing correct and efficient code, especially in loop conditions and validation logic.
- **Flow control is the backbone of logic** (Early): The if/else, switch, while, for, and foreach constructs are the fundamental tools for building dynamic behavior, and knowing when to use each is a core skill.
- **Functions promote reuse and clarity** (Early): Defining functions with clear inputs and outputs, and understanding the default copy-on-write behavior (making references rarely necessary), helps structure code for maintainability.
- **Strings are the currency of web apps** (Middle): PHP's string functions—from concatenation to printf() formatting and searching—are highly optimized, and mastering them is essential for generating HTML, parsing input, and building URLs.
- **Regular expressions require care** (Middle): Greedy quantifiers can cause unexpected matches; using nongreedy variants (e.g., *?) and understanding anchors like \A and \Z are key to reliable pattern matching.
- **Security and performance are advanced but essential** (Late): The book covers secure script practices, error handling, and performance tuning, which are crucial for moving from toy examples to production-ready applications.
【Reading Tips】
- **Skim the history and setup chapters** (Opening): The early sections on PHP's origins are interesting but not critical; focus on the syntax examples and the sample database setup (library.sql) for hands-on practice.
- **Deep-read the operator and flow-control chapters** (Early): These are dense with subtle details (e.g., string increment behavior) that will trip you up later; work through the tables and examples carefully.
- **Practice the string and regex sections** (Middle): These are the most technical parts; write small test scripts to experiment with printf() formats and regex patterns rather than just reading them.
- **Use the database chapter as a capstone project** (Late): The booklist.php example ties together HTML, PHP, and MySQL; modify it to test your understanding of sessions, validation, and error handling.
- **Keep the quick reference handy**: The book includes a reference to core functions and extensions; use it as a lookup tool while coding rather than trying to memorize everything.
【Coverage Limits】
This guide synthesizes the provided excerpts, which cover the book's opening through the middle sections (up to arrays and regex). The later chapters on web techniques, databases, and advanced topics are mentioned in the blurb but not detailed in the excerpts.
ut the following code sample as well as the related samples in Chapter 9. Example 1-4. Querying the books database (booklist.php) <?php $db = new mysqli("loc...
= 3) { for($i = 0; $i < 10; $i++) { // do something } } In this code, someFunction() is called after every third statement within the block is executed. You...
ue with === when testing for failure: if ($pos === false) { // wasn't found } else { // was found, $pos is offset into string } 104 | Chapter 4: Strings Anch...
exitFunction(); } 150 | Chapter 5: Arrays Declaring a Class To design your program or code library in an object-oriented fashion, you’ll need to define your...
file of valid users, or consult a Microsoft domain server. This example checks to make sure that the password is the username reversed (not the most secure a...
Support this siteYour recognition and a small knowledge-service contribution help keep this technical work open source.
Scan the WeChat Pay or Alipay code below. Logged-in and guest visitors can both tip.
WeChat PayAlipay
Open WeChat or Alipay and scan. No login required.
Add Tag
Enter tag name (max 50 characters)
Share E-Book
Programming PHP, 4th Edition Creating Dynamic Web Pages (Covers version 7.4) (Kevin Tatroe, Peter MacIntyre)(Z-Library)
Scan QR code with your phone to access
Copy the link or scan the QR code to access this e-book on your phone
Share E-Book via Email
Please enter email address
Donation Statistics
¥.00
Total Donations
0
Donation Count
Programming PHP, 4th Edition Creating Dynamic Web Pages (Covers version 7.4) (Kevin Tatroe, Peter MacIntyre)(Z-Library)
Find Your Favorite Books
Only registered users can comment after logging in. Comments need to be reviewed by administrators before being displayed
Loading comments...
Reply to Comment
Edit Comment