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 best practices should be followed when using PHP to manipulate HTML elements like checkboxes?
When using PHP to manipulate HTML elements like checkboxes, it is important to ensure proper handling of form submissions to correctly process the checkbox valu...
PHP HTML elements checkboxes -
What are the benefits of using ob_start() and ob_flush() functions to control output in PHP?
When working with PHP, sometimes you may need to control the output that is sent to the browser. This can be achieved using the ob_start() and ob_flush() functi...
ob_start ob_flush output buffering -
What are the steps to properly compile PHP code for XAMPP on Windows 10?
To properly compile PHP code for XAMPP on Windows 10, you need to ensure that the PHP executable is included in your system's PATH environment variable. This al...
XAMPP PHP compile