# PHP Manual

Mehdi Achour
Friedhelm Betz
Antony Dovgal
Nuno Lopes
Georg Richter
Damien Seguy
Jakub Vrana
And several others
2007-11-11
Philip Olson
© 1997-2007 the PHP Documentation Group

- Copyright
- Preface
- Getting Started
  - Introduction
  - A simple tutorial
- Installation and Configuration
  - General Installation Considerations
  - Installation on Unix systems
  - Installation on Mac OS X
  - Installation on Windows systems
  - Installation of PECL extensions
  - Problems?
  - Runtime Configuration
- Language Reference
  - Basic syntax
  - Types
  - Variables
  - Constants
  - Expressions
  - Operators
  - Control Structures
  - Functions
  - Classes and Objects (PHP 4)
  - Classes and Objects (PHP 5)
  - Exceptions
  - References Explained
- Security
  - Introduction
  - General considerations
  - Installed as CGI binary
  - Installed as an Apache module
  - Filesystem Security
  - Database Security
  - Error Reporting
  - Using Register Globals
  - User Submitted Data
  - Magic Quotes
  - Hiding PHP
  - Keeping Current
- Features
  - HTTP authentication with PHP
  - Cookies
  - Sessions
  - Dealing with XForms
  - Handling file uploads
  - Using remote files
  - Connection handling
  - Persistent Database Connections
  - Safe Mode
  - Using PHP from the command line
- Function Reference
  - .NET — .NET Functions
  - Apache — Apache-specific Functions
  - APC — Alternative PHP Cache
  - APD — Advanced PHP debugger
  - Arrays — Array Functions
  - Aspell — Aspell functions [deprecated]
  - BBCode — BBCode Functions
  - BC math — BCMath Arbitrary Precision Mathematics Functions
  - bcompiler — PHP bytecode Compiler
  - Bzip2 — Bzip2 Compression Functions
  - Calendar — Calendar Functions
  - CCVS — CCVS API Functions [deprecated]
  - Classes/Objects — Class/Object Functions
  - Classkit — Classkit Functions
  - ClibPDF — ClibPDF Functions [deprecated]
  - COM — COM and .Net (Windows)
  - Crack — Crack Functions
  - ctype — Character Type Functions
  - CURL — CURL, Client URL Library Functions
  - Cybercash — Cybercash Payment Functions
  - CyberMUT — Credit Mutuel CyberMUT functions
  - Cyrus IMAP — Cyrus IMAP administration Functions
  - Date/Time — Date and Time Functions
  - DB++ — DB++ Functions
  - dba — Database (dbm-style) Abstraction Layer Functions
  - dBase — dBase Functions
  - DBM — DBM Functions [deprecated]
  - dbx — dbx Functions
  - Direct IO — Direct IO Functions
  - Directories — Directory Functions
  - DOM — DOM Functions
  - DOM XML — DOM XML Functions
  - enchant — enchant Functions
  - Errors and Logging — Error Handling and Logging Functions
  - Exif — Exif Functions
  - Expect — Expect Functions
  - fam — File Alteration Monitor Functions
  - FDF — Forms Data Format Functions
  - Fileinfo — Fileinfo Functions
  - filePro — filePro Functions
  - Filesystem — Filesystem Functions
  - Filter — Filter Functions
  - Firebird/InterBase — Firebird/InterBase Functions
  - Firebird/Interbase (PDO) — Firebird/Interbase Functions (PDO_FIREBIRD)
  - FriBiDi — FriBiDi Functions
  - FrontBase — FrontBase Functions
  - FTP — FTP Functions
  - Function handling — Function Handling Functions
  - GeoIP — GeoIP Functions
  - gettext — Gettext Functions
  - GMP — GMP Functions
  - gnupg — gnupg Functions
  - gopher — Net_Gopher
  - haru — Haru PDF Functions
  - hash — hash Functions
  - http — HTTP
  - Hyperwave — Hyperwave Functions
  - Hyperwave API — Hyperwave API Functions
  - i18n — i18n Functions
  - IBM (PDO) — IBM Functions (PDO_IBM)
  - ibm_db2 — IBM DB2, Cloudscape and Apache Derby Functions
  - iconv — iconv Functions
  - id3 — ID3 Functions
  - IIS Functions — IIS Administration Functions
  - Image — Image Functions
  - Imagick Image Library
  - IMAP — IMAP, POP3 and NNTP Functions
  - Informix — Informix Functions
  - Informix (PDO) — Informix Functions (PDO_INFORMIX)
  - Ingres II — Ingres II Functions
  - IRC Gateway — IRC Gateway Functions
  - Java — PHP / Java Integration
  - JSON — JSON Functions
  - kadm5 — KADM5
  - LDAP — LDAP Functions
  - libxml — libxml Functions
  - Lotus Notes — Lotus Notes Functions
  - LZF — LZF Functions
  - Mail — Mail Functions
  - Mailparse — Mailparse Functions
  - Math — Mathematical Functions
  - MaxDB — MaxDB PHP Extension
  - MCAL — MCAL Functions
  - mcrypt — Mcrypt Encryption Functions
  - MCVE — MCVE (Monetra) Payment Functions
  - Memcache — Memcache Functions
  - mhash — Mhash Functions
  - Mimetype — Mimetype Functions
  - Ming (flash) — Ming functions for Flash
  - Misc. — Miscellaneous Functions
  - mnoGoSearch — mnoGoSearch Functions
  - MS SQL Server — Microsoft SQL Server Functions
  - MS SQL Server (PDO) — Microsoft SQL Server and Sybase Functions (PDO_DBLIB)
  - Msession — Mohawk Software Session Handler Functions
  - mSQL — mSQL Functions
  - Multibyte String — Multibyte String Functions
  - muscat — muscat Functions
  - MySQL — MySQL Functions
  - MySQL (PDO) — MySQL Functions (PDO_MYSQL)
  - mysqli — MySQL Improved Extension
  - Ncurses — Ncurses Terminal Screen Control Functions
  - Network — Network Functions
  - Newt — Newt Functions
  - NSAPI — NSAPI-specific Functions
  - Object Aggregation — Object Aggregation/Composition Functions
  - Object overloading — Object property and method call overloading
  - OCI8 — Oracle Functions
  - ODBC — ODBC Functions (Unified)
  - ODBC and DB2 (PDO) — ODBC and DB2 Functions (PDO_ODBC)
  - OGG/Vorbis — oggvorbis
  - openal — OpenAL Audio Bindings
  - OpenSSL — OpenSSL Functions
  - Oracle — Oracle Functions [deprecated]
  - Oracle (PDO) — Oracle Functions (PDO_OCI)
  - Output Control — Output Control Functions
  - OvrimosSQL — Ovrimos SQL Functions
  - Paradox — Paradox File Access
  - Parsekit — Parsekit Functions
  - PCNTL — Process Control Functions
  - PCRE — Regular Expression Functions (Perl-Compatible)
  - PDF — PDF Functions
  - PDO — PDO Functions
  - phar — Phar archive stream and classes
  - PHP Options/Info — PHP Options&Information
  - POSIX — POSIX Functions
  - POSIX Regex — Regular Expression Functions (POSIX Extended)
  - PostgreSQL — PostgreSQL Functions
  - PostgreSQL (PDO) — PostgreSQL Functions (PDO_PGSQL)
  - Printer — Printer Functions
  - Program Execution — Program Execution Functions
  - PS — PostScript document creation
  - Pspell — Pspell Functions
  - qtdom — qtdom Functions
  - radius — Radius
  - Rar — Rar Functions
  - Readline — GNU Readline
  - Recode — GNU Recode Functions
  - RPMReader — RPM Header Reading Functions
  - runkit — runkit Functions
  - SAM — SAM - Simple Asynchronous Messaging
  - Satellite — Satellite CORBA client extension [deprecated]
  - SCA — SCA Functions
  - SDO — SDO Functions
  - SDO DAS XML — SDO XML Data Access Service Functions
  - SDO-DAS-Relational — SDO Relational Data Access Service Functions
  - Semaphore — Semaphore, Shared Memory and IPC Functions
  - SESAM — SESAM Database Functions
  - Session PgSQL — PostgreSQL Session Save Handler
  - Sessions — Session Handling Functions
  - shmop — Shared Memory Functions
  - SimpleXML — SimpleXML functions
  - SNMP — SNMP Functions
  - SOAP — SOAP Functions
  - Sockets — Socket Functions
  - spl — Standard PHP Library (SPL) Functions
  - SQLite — SQLite Functions
  - SQLite (PDO) — SQLite Functions (PDO_SQLITE)
  - ssh2 — Secure Shell2 Functions
  - Statistics — Statistics Functions
  - Streams — Stream Functions
  - Strings — String Functions
  - SVN — Subversion Functions
  - SWF — Shockwave Flash Functions
  - swish — Swish Functions
  - Sybase — Sybase Functions
  - TCP Wrappers — TCP Wrappers Functions
  - tidy — Tidy Functions
  - Tokenizer — Tokenizer Functions
  - Unicode — Unicode Functions
  - URLs — URL Functions
  - Variables handling — Variable Handling Functions
  - Verisign Payflow Pro — Verisign Payflow Pro Functions
  - vpopmail — vpopmail Functions
  - W32api — W32api Functions
  - WDDX — WDDX Functions
  - win32ps — win32ps Functions
  - win32service — win32service Functions
  - xattr — xattr Functions
  - xdiff — xdiff Functions
  - XML — XML Parser Functions
  - XML-RPC — XML-RPC Functions
  - XMLReader — XMLReader functions
  - XMLWriter — XMLWriter Functions
  - XSL — XSL functions
  - XSLT — XSLT Functions
  - YAZ — YAZ Functions
  - YP/NIS — YP/NIS Functions
  - Zip — Zip File Functions
  - Zlib — Zlib Compression Functions
- PHP at the Core: A Hacker's Guide to the Zend Engine
  - The PHP 5 build system
  - Extension structure
  - Memory management
  - Working with variables
  - Writing functions
  - Working with classes and objects
  - Working with resources
  - Working with INI settings
  - Working with streams
  - PDO Driver How-To
  - Extension FAQs
  - Zend Engine 2 API reference
  - Zend Engine 1
  - The future: PHP 6 and Zend Engine 3
- FAQ — FAQ: Frequently Asked Questions
  - General Information
  - Mailing lists
  - Obtaining PHP
  - Database issues
  - Installation
  - Build Problems
  - Using PHP
  - PHP and HTML
  - PHP and COM
  - PHP and other languages
  - Migrating from PHP 2 to PHP 3
  - Migrating from PHP 3 to PHP 4
  - Migrating from PHP 4 to PHP 5
  - Miscellaneous Questions
- Appendices
  - History of PHP and related projects
  - Migrating from PHP 5.1.x to PHP 5.2.x
  - Migrating from PHP 5.0.x to PHP 5.1.x
  - Migrating from PHP 4 to PHP 5
  - Migrating from PHP 3 to PHP 4
  - Migrating from PHP/FI 2 to PHP 3
  - Debugging PHP
  - Configure options
  - php.ini directives
  - List of Supported Timezones
  - Extension Categorization
  - List of Function Aliases
  - List of Reserved Words
  - List of Resource Types
  - List of Supported Protocols/Wrappers
  - List of Available Filters
  - List of Supported Socket Transports
  - PHP type comparison tables
  - List of Parser Tokens
  - Userland Naming Guide
  - About the manual
  - Open Publication License
  - Function Index