Book description
Now installed on more than 20 million Internet domains around the world, PHP is an undisputed leader in web programming languages. Database connectivity, powerful extensions, and rich object-orientation are all reasons for its popularity, but nearly everyone would agree that, above all, PHP is one of the easiest languages to learn and use for developing dynamic web applications. The ease of development and simplicity of PHP, combined with a large community and expansive repository of open source PHP libraries, make it a favorite of web designers and developers worldwide.
PHP in a Nutshell is a complete reference to the core of the language as well as the most popular PHP extensions. This book doesn't try to compete with or replace the widely available online documentation. Instead, it is designed to provide depth and breadth that can't be found elsewhere. PHP in a Nutshell provides the maximum information density on PHP, without all the fluff and extras that get in the way. The topic grouping, tips, and examples in this book complement the online guide and make this an essential reference for every PHP programmer. This book focuses on the functions commonly used by a majority of developers, so you can look up the information you need quickly. Topics include:
- Object-oriented PHP
- Networking
- String manipulation
- Working with files
- Database interaction
- XML
- Multimedia creation
- Mathematics
Whether you're just getting started or have years of experience in PHP development, PHP in a Nutshell is a valuable addition to your desk library.
Publisher resources
Table of contents
-
PHP in a Nutshell
- SPECIAL OFFER: Upgrade this ebook with OâReilly
- About the Author
- Preface
- 1. Introduction to PHP
- 2. Installing PHP
- 3. The PHP Interpreter
-
4. The PHP Language
- 4.1. The Basics of PHP
- 4.2. Variables
- 4.3. Whitespace
- 4.4. Heredoc
- 4.5. Brief Introduction to Variable Types
- 4.6. Code Blocks
- 4.7. Opening and Closing Code Islands
- 4.8. Comments
- 4.9. Conditional Statements
- 4.10. Case Switching
- 4.11. Loops
- 4.12. Infinite Loops
- 4.13. Special Loop Keywords
- 4.14. Loops Within Loops
- 4.15. Mixed-Mode Processing
- 4.16. Including Other Files
-
4.17. Functions
- 4.17.1. A Simple User Function
- 4.17.2. Return Values
- 4.17.3. Parameters
- 4.17.4. Passing By Reference
- 4.17.5. Returning by Reference
- 4.17.6. Default Parameters
- 4.17.7. Variable Parameter Counts
- 4.17.8. Variable Scope in Functions
- 4.17.9. Overriding Scope with the GLOBALS Array
- 4.17.10. Recursive Functions
-
5. Variables and Constants
- 5.1. Types of Data
- 5.2. True or False
- 5.3. Strings
- 5.4. Integers
- 5.5. Floats
- 5.6. Automatic Type Conversion
- 5.7. Checking Whether a Variable Is Set: isset()
- 5.8. Variable Scope
- 5.9. Variable Variables
- 5.10. Superglobals
- 5.11. Using $_ENV and $_SERVER
- 5.12. References
- 5.13. Constants
- 5.14. Arrays
-
6. Operators
- 6.1. Arithmetic Operators
- 6.2. Assignment Operators
- 6.3. String Operators
- 6.4. Bitwise Operators
- 6.5. Comparison Operators
- 6.6. Incrementing and Decrementing Operators
- 6.7. Logical Operators
- 6.8. Some Operator Examples
- 6.9. The Ternary Operator
- 6.10. The Execution Operator
- 6.11. Operator Precedence and Associativity
-
7. Function Reference
- 7.1. Undocumented Functions
-
7.2. Handling Non-English Characters
- abs()
- acos()
- addslashes()
- asin()
- atan()
- base_convert()
- bindec()
- call_user_func()
- call_user_func_array()
- ceil()
- chr()
- connection_status()
- cos()
- count_chars()
- date()
- decbin()
- dechex()
- decoct()
- deg2rad()
- die()
- dl()
- empty()
- escapeshellcmd()
- eval()
- exec()
- exit()
- floor()
- function_exists()
- get_extension_funcs()
- get_loaded_extensions()
- hexdec()
- html_entities()
- html_entity_decode()
- ignore_user_abort()
- ini_get()
- ini_set()
- is_callable()
- isset()
- ltrim()
- md5()
- microtime()
- mktime()
- mt_rand()
- nl2br()
- number_format()
- octdec()
- ord()
- parse_str()
- passthru()
- pow()
- printf()
- rad2deg()
- rand()
- rawurldecode()
- rawurlencode()
- register_shutdown_function()
- round()
- rtrim()
- set_time_limit()
- sha1()
- sin()
- sleep()
- sqrt()
- str_pad()
- str_replace()
- str_word_count()
- strcasecmp()
- strcmp()
- strip_tags()
- stripslashes()
- strlen()
- strpos()
- strstr()
- strtolower()
- strtotime()
- strtoupper()
- substr()
- tan()
- time()
- trim()
- ucfirst()
- ucwords()
- unset()
- usleep()
- virtual()
- wordwrap()
-
8. Object-Oriented PHP
- 8.1. Conceptual Overview
- 8.2. Classes
- 8.3. Objects
- 8.4. Properties
- 8.5. The 'this' Variable
- 8.6. Objects Within Objects
- 8.7. Access Control Modifiers
- 8.8. Object Type Information
- 8.9. Class Type Hints
- 8.10. Constructors and Destructors
- 8.11. Copying Objects
- 8.12. Comparing Objects with == and ===
- 8.13. Saving Objects
- 8.14. Magic Methods
- 8.15. Static Class Methods and Properties
- 8.16. Helpful Utility Functions
- 8.17. Interfaces
- 8.18. Dereferencing Object Return Values
- 9. HTML Forms
- 10. Cookies and Sessions
- 11. Output Buffering
- 12. Security
-
13. Files
- 13.1. Reading Files
- 13.2. Creating and Changing Files
- 13.3. Moving, Copying, and Deleting Files
- 13.4. Other File Functions
- 13.5. Checking Whether a File Exists
- 13.6. Retrieving File Time Information
- 13.7. Dissecting Filename Information
- 13.8. Handling File Uploads
- 13.9. Locking Files with flock()
- 13.10. Reading File Permissions and Status
- 13.11. Changing File Permissions and Ownership
- 13.12. Working with Links
- 13.13. Working with Directories
- 13.14. Remote Files
- 13.15. File Checksums
- 13.16. Parsing a Configuration File
- 14. Databases
-
15. Regular Expressions
- 15.1. Basic Regexps with preg_match() and preg_match_all()
- 15.2. Regexp Character Classes
- 15.3. Regexp Special Characters
- 15.4. Words and Whitespace Regexps
- 15.5. Storing Matched Strings
- 15.6. Regular Expression Replacements
- 15.7. Regular Expression Syntax Examples
- 15.8. The Regular Expressions Coach
-
16. Manipulating Images
- 16.1. Getting Started
- 16.2. Choosing a Format
- 16.3. Getting Arty
- 16.4. More Shapes
- 16.5. Complex Shapes
- 16.6. Outputting Text
- 16.7. Loading Existing Images
- 16.8. Color and Image Fills
- 16.9. Adding Transparency
- 16.10. Using Brushes
- 16.11. Basic Image Copying
- 16.12. Scaling and Rotating
- 16.13. Points and Lines
- 16.14. Special Effects Using imagefilter()
- 16.15. Interlacing an Image
- 16.16. Getting an Image's MIME Type
- 17. Creating PDFs
- 18. Creating Flash
- 19. XML & XSLT
- 20. Network Programming
-
21. Distributing Your Code
- 21.1. Cross-Platform Code 1: Loading Extensions
- 21.2. Cross-Platform Code 2: Using Extensions
- 21.3. Cross-Platform Code 3: Path and Line Separators
- 21.4. Cross-Platform Code 4: Coping with php.ini Differences
- 21.5. Cross-Platform Code 5: Checking the PHP Version with phpversion() and version_compare()
-
22. Debugging
- 22.1. The Most Basic Debugging Technique
- 22.2. Making Assertions
- 22.3. Triggering Your Own Errors
- 22.4. Testing with php_check_syntax()
- 22.5. Source Highlighting
- 22.6. Handling MySQL Errors
- 22.7. Exception Handling
- 22.8. Backtracing Your Code
- 22.9. Custom Error Handlers
- 22.10. Custom Exception Handlers
- 22.11. Using @ to Disable Errors
- 22.12. phpinfo()
- 22.13. Output Style
- 23. Performance
- About the Author
- Colophon
- SPECIAL OFFER: Upgrade this ebook with OâReilly
Product information
- Title: PHP in a Nutshell
- Author(s):
- Release date: October 2005
- Publisher(s): O'Reilly Media, Inc.
- ISBN: 9781449379124
You might also like
book
Generative Deep Learning, 2nd Edition
Generative AI is the hottest topic in tech. This practical book teaches machine learning engineers and …
book
Building Micro-Frontends
What's the answer to today's increasingly complex web applications? Micro-frontends. Inspired by the microservices model, this …
book
Web-Based Projects that Rock the Class: Build Fully-Functional Web Apps and Learn Through Doing
Explore the modern concepts of client-server web applications. This book includes examples that are simple to …
book
Mythical Man-Month, The: Essays on Software Engineering, Anniversary Edition, 2nd Edition
Few books on software project management have been as influential and timeless as The Mythical Man-Month. …