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 potential pitfalls of not checking for file upload errors in PHP?
Potential pitfalls of not checking for file upload errors in PHP include allowing potentially harmful files to be uploaded to your server, not being able to han...
file upload errors PHP -
How can Object Relational Mapping (ORM) be implemented in PHP programs for efficient database storage of objects?
Object Relational Mapping (ORM) can be implemented in PHP programs using libraries such as Doctrine or Eloquent to efficiently store objects in a database. Thes...
ORM PHP database storage -
What are the advantages and disadvantages of using a centralized index file for including PHP scripts versus individual header files for specific functionalities?
Using a centralized index file for including PHP scripts can make managing dependencies easier and reduce redundancy in including header files. However, it can...
Centralized index file PHP scripts header files