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 debugging techniques be used to troubleshoot issues with PHP scripts that involve sending emails?
To troubleshoot email sending issues in PHP scripts, you can use debugging techniques like checking for errors in the email configuration settings, ensuring the...
PHP debugging email -
Are there any built-in PHP functions or libraries that provide a more elegant solution for splitting a string into individual characters?
When splitting a string into individual characters in PHP, one common approach is to use a combination of `str_split()` and `mb_substr()` functions. However, PH...
PHP string split -
What are the limitations of using HTML <option> tags in displaying multiple columns of data in a dropdown list in PHP?
When using HTML <option> tags in a dropdown list, it is not possible to display multiple columns of data directly. One way to work around this limitation is to...
HTML <option> tags dropdown list