
Programming PHP
Description
Alles über E-Books | Antworten auf Fragen rund um E-Books, Kopierschutz und Dateiformate finden Sie in unserem Info- & Hilfebereich.
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
More details
Other editions
Additional editions

Content
- Intro
- Copyright
- Table of Contents
- Foreword
- Preface
- Audience
- Assumptions This Book Makes
- Contents of This Book
- Conventions Used in This Book
- O'Reilly Online Learning
- How to Contact Us
- Acknowledgments
- Kevin Tatroe
- Peter MacIntyre
- Chapter 1. Introduction to PHP
- What Does PHP Do?
- A Brief History of PHP
- The Evolution of PHP
- The Widespread Use of PHP
- Installing PHP
- A Walk Through PHP
- Configuration Page
- Forms
- Databases
- Graphics
- What's Next
- Chapter 2. Language Basics
- Lexical Structure
- Case Sensitivity
- Statements and Semicolons
- Whitespace and Line Breaks
- Comments
- Literals
- Identifiers
- Keywords
- Data Types
- Integers
- Floating-Point Numbers
- Strings
- Booleans
- Arrays
- Objects
- Resources
- Callbacks
- NULL
- Variables
- Variable Variables
- Variable References
- Variable Scope
- Garbage Collection
- Expressions and Operators
- Number of Operands
- Operator Precedence
- Operator Associativity
- Implicit Casting
- Arithmetic Operators
- String Concatenation Operator
- Auto-Increment and Auto-Decrement Operators
- Comparison Operators
- Bitwise Operators
- Logical Operators
- Casting Operators
- Assignment Operators
- Miscellaneous Operators
- Flow-Control Statements
- if
- switch
- while
- for
- foreach
- try...catch
- declare
- exit and return
- goto
- Including Code
- Embedding PHP in Web Pages
- Standard (XML) Style
- SGML Style
- Echoing Content Directly
- What's Next
- Chapter 3. Functions
- Calling a Function
- Defining a Function
- Variable Scope
- Global Variables
- Static Variables
- Function Parameters
- Passing Parameters by Value
- Passing Parameters by Reference
- Default Parameters
- Variable Parameters
- Missing Parameters
- Type Hinting
- Return Values
- Variable Functions
- Anonymous Functions
- What's Next
- Chapter 4. Strings
- Quoting String Constants
- Variable Interpolation
- Single-Quoted Strings
- Double-Quoted Strings
- Here Documents
- Printing Strings
- echo
- print()
- printf()
- print_r() and var_dump()
- Accessing Individual Characters
- Cleaning Strings
- Removing Whitespace
- Changing Case
- Encoding and Escaping
- HTML
- URLs
- SQL
- C-String Encoding
- Comparing Strings
- Exact Comparisons
- Approximate Equality
- Manipulating and Searching Strings
- Substrings
- Miscellaneous String Functions
- Decomposing a String
- String-Searching Functions
- Regular Expressions
- The Basics
- Character Classes
- Alternatives
- Repeating Sequences
- Subpatterns
- Delimiters
- Match Behavior
- Character Classes
- Anchors
- Quantifiers and Greed
- Noncapturing Groups
- Backreferences
- Trailing Options
- Inline Options
- Lookahead and Lookbehind
- Cut
- Conditional Expressions
- Functions
- Differences from Perl Regular Expressions
- What's Next
- Chapter 5. Arrays
- Indexed Versus Associative Arrays
- Identifying Elements of an Array
- Storing Data in Arrays
- Appending Values to an Array
- Assigning a Range of Values
- Getting the Size of an Array
- Padding an Array
- Multidimensional Arrays
- Extracting Multiple Values
- Slicing an Array
- Splitting an Array into Chunks
- Keys and Values
- Checking Whether an Element Exists
- Removing and Inserting Elements in an Array
- Converting Between Arrays and Variables
- Creating Variables from an Array
- Creating an Array from Variables
- Traversing Arrays
- The foreach Construct
- The Iterator Functions
- Using a for Loop
- Calling a Function for Each Array Element
- Reducing an Array
- Searching for Values
- Sorting
- Sorting One Array at a Time
- Natural-Order Sorting
- Sorting Multiple Arrays at Once
- Reversing Arrays
- Randomizing Order
- Acting on Entire Arrays
- Calculating the Sum of an Array
- Merging Two Arrays
- Calculating the Difference Between Two Arrays
- Filtering Elements from an Array
- Using Arrays to Implement Data Types
- Sets
- Stacks
- Implementing the Iterator Interface
- What's Next
- Chapter 6. Objects
- Objects
- Terminology
- Creating an Object
- Accessing Properties and Methods
- Declaring a Class
- Declaring Methods
- Declaring Properties
- Declaring Constants
- Inheritance
- Interfaces
- Traits
- Abstract Methods
- Constructors
- Destructors
- Anonymous Classes
- Introspection
- Examining Classes
- Examining an Object
- Sample Introspection Program
- Serialization
- What's Next
- Chapter 7. Dates and Times
- What's Next
- Chapter 8. Web Techniques
- HTTP Basics
- Variables
- Server Information
- Processing Forms
- Methods
- Parameters
- Self-Processing Pages
- Sticky Forms
- Multivalued Parameters
- Sticky Multivalued Parameters
- File Uploads
- Form Validation
- Setting Response Headers
- Different Content Types
- Redirections
- Expiration
- Authentication
- Maintaining State
- Cookies
- Sessions
- Combining Cookies and Sessions
- SSL
- What's Next
- Chapter 9. Databases
- Using PHP to Access a Database
- Relational Databases and SQL
- PHP Data Objects
- MySQLi Object Interface
- Retrieving Data for Display
- SQLite
- Direct File-Level Manipulation
- MongoDB
- Retrieving Data
- Inserting More Complex Data
- What's Next
- Chapter 10. Graphics
- Embedding an Image in a Page
- Basic Graphics Concepts
- Creating and Drawing Images
- The Structure of a Graphics Program
- Changing the Output Format
- Testing for Supported Image Formats
- Reading an Existing File
- Basic Drawing Functions
- Images with Text
- Fonts
- TrueType Fonts
- Dynamically Generated Buttons
- Caching the Dynamically Generated Buttons
- A Faster Cache
- Scaling Images
- Color Handling
- Using the Alpha Channel
- Identifying Colors
- True Color Indexes
- Text Representation of an Image
- What's Next
- Chapter 11. PDF
- PDF Extensions
- Documents and Pages
- A Simple Example
- Initializing the Document
- Outputting Basic Text Cells
- Text
- Coordinates
- Text Attributes
- Page Headers, Footers, and Class Extension
- Images and Links
- Tables and Data
- What's Next
- Chapter 12. XML
- Lightning Guide to XML
- Generating XML
- Parsing XML
- Element Handlers
- Character Data Handler
- Processing Instructions
- Entity Handlers
- Default Handler
- Options
- Using the Parser
- Errors
- Methods as Handlers
- Sample Parsing Application
- Parsing XML with the DOM
- Parsing XML with SimpleXML
- Transforming XML with XSLT
- What's Next
- Chapter 13. JSON
- Using JSON
- Serializing PHP Objects
- Options
- What's Next
- Chapter 14. Security
- Safeguards
- Filtering Input
- Escaping Output Data
- Security Vulnerabilities
- Cross-Site Scripting
- SQL Injection
- Filename Vulnerabilities
- Session Fixation
- File Upload Traps
- Unauthorized File Access
- PHP Code Issues
- Shell Command Weaknesses
- Data Encryption Concerns
- Further Resources
- Security Recap
- What's Next
- Chapter 15. Application Techniques
- Code Libraries
- Templating Systems
- Handling Output
- Output Buffering
- Output Compression
- Performance Tuning
- Benchmarking
- Profiling
- Optimizing Execution Time
- Optimizing Memory Requirements
- Reverse Proxies and Replication
- What's Next
- Chapter 16. Web Services
- REST Clients
- Responses
- Retrieving Resources
- Updating Resources
- Creating Resources
- Deleting Resources
- XML-RPC
- Servers
- Clients
- What's Next
- Chapter 17. Debugging PHP
- The Development Environment
- The Staging Environment
- The Production Environment
- php.ini Settings
- Error Handling
- Error Reporting
- Exceptions
- Error Suppression
- Triggering Errors
- Defining Error Handlers
- Manual Debugging
- Error Logs
- IDE Debugging
- Additional Debugging Techniques
- What's Next
- Chapter 18. PHP on Disparate Platforms
- Writing Portable Code for Windows and Unix
- Determining the Platform
- Handling Paths Across Platforms
- Navigating the Server Environment
- Sending Mail
- End-of-Line Handling
- End-of-File Handling
- Using External Commands
- Accessing Platform-Specific Extensions
- Interfacing with COM
- Background
- PHP Functions
- API Specifications
- Function Reference
- PHP Functions by Category
- Arrays
- Classes and Objects
- Data Filtering
- Date and Time
- Directories
- Errors and Logging
- Filesystem
- Functions
- Math
- Miscellaneous Functions
- Network
- Output Buffering
- PHP Language Tokenizer
- PHP Options/Info
- Program Execution
- Session Handling
- Streams
- Strings
- URLs
- Variables
- Zlib
- Alphabetical Listing of PHP Functions
- Index
- About the Authors
- Colophon
System requirements
File format: PDF
Copy-Protection: Adobe-DRM (Digital Rights Management)
System requirements:
- Computer (Windows; MacOS X; Linux): Install the free reader Adobe Digital Editions prior to download (see eBook Help).
- Tablet/smartphone (Android; iOS): Install the free app Adobe Digital Editions or the app PocketBook before downloading (see eBook Help).
- E-reader: Bookeen, Kobo, Pocketbook, Sony, Tolino and many more (only limited: Kindle).
The file format PDF always displays a book page identically on any hardware. This makes PDF suitable for complex layouts such as those used in textbooks and reference books (images, tables, columns, footnotes). Unfortunately, on the small screens of e-readers or smartphones, PDFs are rather annoying, requiring too much scrolling.
This eBook uses Adobe-DRM, a „hard” copy protection. If the necessary requirements are not met, unfortunately you will not be able to open the eBook. You will therefore need to prepare your reading hardware before downloading.
Please note: We strongly recommend that you authorise using your personal Adobe ID after installation of any reading software.
For more information, see our eBook Help page.