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
-
What are the benefits of separating PHP processing from HTML output in web development projects?
Separating PHP processing from HTML output in web development projects helps to improve code organization, maintainability, and readability. It also allows for...
PHP processing HTML output separation of concerns -
What are the advantages and disadvantages of using the Google Maps SDK versus OpenStreetMap in a PHP project?
When deciding between using the Google Maps SDK and OpenStreetMap in a PHP project, it is important to consider the advantages and disadvantages of each. Adva...
Google Maps SDK OpenStreetMap PHP project -
What are the potential pitfalls of not specifying the data type when retrieving results from a MySQL query in PHP?
Not specifying the data type when retrieving results from a MySQL query in PHP can lead to unexpected results or errors in your code. It is important to specify...
MySQL PHP data type