PHP questions, answered with working code.
Search explained answers, or work through a guide from your first script to namespaces.
Popular: password_hash · PDO · sessions · array_map · json_decode
Guides
Introduction to PHP
Syntax, variables, arrays, functions, forms and basic security.
14 sections
IntermediateSessions & Cookies
Keep state between requests: creating cookies, storing and destroying session data.
9 sections
AdvancedNamespaces
Organise larger codebases, avoid name collisions and understand name resolution.
7 sections
From the knowledge base
-
How can PHP handle special characters like umlauts when processing email content?
When processing email content in PHP, special characters like umlauts can be handled by using the mbstring extension functions to properly encode and decode the...
PHP special characters umlauts -
Are there any specific settings or options in phpMyAdmin that need to be enabled to include column headers in CSV exports?
When exporting data from phpMyAdmin to a CSV file, column headers are not included by default. To include column headers in CSV exports, you need to enable the...
phpMyAdmin settings options -
What are the advantages and disadvantages of using single quotes versus double quotes in PHP for string interpolation?
When using single quotes in PHP for string interpolation, variables and escape sequences are not interpreted within the string. This can be advantageous when yo...
single quotes double quotes string interpolation