The Web is by far the largest medium for team and individual communication. The web page carries panoramic images of the earth taken by artificial satellites, exploration of life in outer space, family personal photo albums, shopping carts and product lists. Many web pages are powered by PHP, an open source scripting language built for HTML.
Since its creation in 1994, PHP has taken the web by storm due to its phenomenal growth and has been recommended by IBM and Oracle (to name a few).
Millions of websites use PHP, a testament to its popularity and ease of use. Every day people learn PHP and build powerful dynamic web pages. Marc Andreessen, partner at Andreessen Horowitz and founder of the Netscape community, recently said that PHP has overtaken Java as the dominant Web language.
The language core after PHP 5 highlights powerful string and array processing tools, as well as object-oriented support and optimization. With optional extension modules, a PHP application can interact with MySQL or Oracle databases, draw graphics, create PDF files, and parse XML files. You can write your own extension modules in C, for example, to provide a PHP interface to an existing code base. You can also run PHP on Windows, which also allows you to control other Windows applications, such as using COM to call Word and Excel, or using ODBC to interact with a database.
This book is a guide to the PHP language. When you finish reading, you will know how the PHP language works, how to use powerful extensions in standard PHP, and how to design your own PHP web program. reader
PHP is a cultural melting pot. Web designers will appreciate its ease of use and convenience, and programmers will appreciate its scalability, power, diversity, and speed. Both cultures need to be translated clearly and precisely into language. If you are a programmer, this book is for you. We present the blueprint of the PHP language and don't waste your time discussing specific examples. Many examples are explained in detail, and practical programming advice and coding style tips will make you not just a PHP programmer, but a better PHP programmer.
If you're a web designer, you'll find clear and helpful guides for specific technologies, such as XML, sessions, PDF generation, and images. You can quickly get the information you need, basic programming principles expressed in simple terms. This book has been completely proofread to cope with the latest PHP 5 features.
Premise
This book assumes that you have experience working with HTML. If you don't know HTML, you need to gain some experience with some simple web pages before learning PHP. For more information about HTML, we recommend the book HTML & XHTML: The Definitive Guide by Chunk Musciano and Bill Kennedy (published by O’Reilly).
Contents of this book
We have carefully organized the content of this book so that you can read it sequentially from the beginning or skip to topics of interest. The book has 17 chapters and 1 appendix. As follows.
Chapter 1, Introduction to PHP
Gives a history of PHP and an overview of what can be done with PHP programs.
Chapter 2, Language Basics
A concise guide to PHP elements. Such as definers, data types, operators and flow control statements.
Chapter 3, Functions
Discuss user-defined functions. Contains scope, variable-length argument lists, variables, and anonymous functions.
Chapter 4, Strings
Covers the functions you need to use to build, parse, search, and modify strings in PHP code.
Chapter 5, Arrays
Introduces functions and detailed comments for constructing, processing, and sorting arrays using PHP code.
Chapter 6, Objects
Covers the new object-oriented features of PHP. In this chapter, you will learn about classes, objects, inheritance, and introspection.
Chapter 7, Web Technologies
Discusses web fundamentals such as form parameters and validation, cookies, and sessions.
Chapter 8, Database
Discusses PHP's modules and functions for using databases, using the PEAR database and the MySQL database as examples. At the same time, the SQLite database engine and the new PDO interface will also be covered.
Chapter 9, Images
Demonstrates how to use PHP to create and modify image files in different formats.
Chapter 10, PDF
Explains how to create dynamic PDF files from PHP programs.
Chapter 11, XML
Introducing updated extensions to PHP for generating and parsing XML data.
Chapter 12, Security
Provides valuable advice and guidance for programmers to create secure scripts. You'll learn programming best practices to help you avoid disastrous mistakes.
Chapter 13, Application Technology
Describes advanced techniques that most PHP programmers will eventually use, and introduces error handling and performance tuning.
Chapter 14, PHP on Different Platforms
Explain the tricks and pitfalls of PHP on Windows, and also talk about the unique COM features on Windows.
Chapter 15, Web Services
Provides technology for creating modern web service APIs using PHP and connecting APIs to other systems.
Chapter 16, Debugging PHP
Describes techniques for debugging PHP code and how to write debuggable PHP code.
Chapter 17, Date and Time
Describes PHP's built-in classes for handling dates and times.
Appendix A
A quick reference for all core PHP functions.
This book agrees
This book uses the following typographical conventions:
Italic
Represents new terms, URLs, email addresses, file names, and file extensions.
Constant width
Used to represent program code, and also used to reference variable or function names, databases, data types, environment variables, expressions, and keywords in a normal paragraph.
Constant width bold
Represents a command or text that the user must enter correctly.
Constant width italic
The user must replace the text with their own value or a contextual value.
This icon indicates a tip, suggestion, or general note.
This icon indicates a warning or caution.
The notches in the Chinese version of the book are marked with " " to indicate the page number of the original book, making it easier for readers to compare and read with the original English version of the book. The page numbers listed in the index of this book are the page numbers of the original English version.