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 developers ensure that the truncated string remains readable and meaningful to users?
When truncating a string in PHP, developers can ensure that the truncated string remains readable and meaningful to users by using functions like `mb_strimwidth...
string truncation readability meaningfulness -
How can the move_uploaded_file() function be properly utilized in PHP image uploads?
When uploading images in PHP, the move_uploaded_file() function is used to move the uploaded file to a specified destination. To properly utilize this function,...
move_uploaded_file PHP image uploads -
How can PHP developers efficiently track and analyze error logs in both web server and PHP logs?
To efficiently track and analyze error logs in both web server and PHP logs, PHP developers can utilize tools like log management systems or log monitoring serv...
PHP error logs web server