Questions

PHP questions

Choose a question page, learn the concept, then test your understanding with a quiz.

How to Send a POST Request with PHP and Read the Response

Learn how to send POST requests in PHP, pass parameters, and read the response using cURL, streams, and practical examples.

phphttppostrequest

How to Set Up UTF-8 End to End in PHP, MySQL, and Apache

Learn how to configure UTF-8 correctly across PHP, MySQL, Apache, HTML, and databases to avoid charset mismatches in web apps.

phpmysqlapacheutf-8

How to Show Useful Error Messages in PHP

Learn how to enable useful PHP error messages, debug blank pages, and configure error reporting safely in development and production.

phpdebuggingerror-handling

How to Sort a 2D Array by a Column Value in PHP

Learn how to sort a 2D array by a column value in PHP using usort, spaceship operator, and practical examples for associative arrays.

phparrayssortingmultidimensional-array

How to Sort an Array of Associative Arrays by Column Value in PHP

Learn how to sort an array of associative arrays by a column value in PHP using usort, comparison functions, and practical examples.

phparrayssortingmultidimensional-array

How to Sort an Array of Objects by Property in PHP

Learn how to sort an array of objects by a property in PHP using usort, spaceship operator, and custom comparison functions.

phparrayssortingobject

How to Structure the Model in MVC with PHP

Learn what belongs in the Model in MVC, how to separate entities and data access in PHP, and when extra layers improve code structure.

phpoopmodel-view-controllerarchitecture

JSON vs serialize() in PHP: Choosing How to Store Arrays

Learn when to use JSON or serialize() to store PHP arrays, including performance, portability, pitfalls, and practical caching guidance.

phpperformancearraysjson

Long Polling vs SSE vs WebSockets vs Comet in JavaScript

Learn Long Polling, SSE, WebSockets, and Comet in JavaScript, how they keep connections open, and when to use each for real-time apps.

phpwebsocketcometlong-polling

Loop Through Dynamic JSON Keys in PHP with foreach

Learn how to decode JSON into PHP arrays and use foreach to access dynamic object keys and nested values safely and clearly.

phpjson

Multiple Where Clauses in Laravel Eloquent

Learn how to write multiple WHERE conditions in Laravel Eloquent using chained where calls, arrays, and grouped query logic.

phplaraveleloquentlaravel-query-builder

Multithreading and Concurrent Processing in PHP Applications

Learn practical PHP concurrency using worker processes, pcntl, proc_open, job queues, and the parallel extension without leaking processes.

phpmultithreading

Override a PHP Trait Method and Call the Original Method

Learn how to override a PHP trait method while preserving access to its original implementation through trait method aliases.

phptraits

PHP Closures and the use Keyword Explained

Learn what PHP closures are, how anonymous functions work, and why the use keyword imports outer variables by value or reference.

phpclosures

PHP Date and Time Formatting Like MySQL NOW()

Learn how to generate a MySQL NOW()-style datetime string in PHP using date() and understand formatting, timestamps, and common mistakes.

phpdatetimetimetimestamp

PHP Elvis Operator (?:) vs Null Coalescing Operator (??)

Learn the difference between PHP's short ternary operator (?:) and null coalescing operator (??) with examples, edge cases, and best practices.

phpconditional-operatornull-coalescing-operatorelvis-operator

PHP Enumerations: How to Model Enums Before and With Native Enums

Learn how to represent enumerations in PHP, common workarounds, native enum syntax, and when to use constants or enum classes.

phpenumeration

PHP Equality vs Identity: Understanding == and ===

Learn the difference between PHP == and ===, how loose and strict comparisons work, and when to use each with clear examples.

phpoperators

PHP Error Log Location: Apache, FastCGI, and cPanel

Learn how PHP chooses an error log location with Apache, FastCGI, and cPanel, and how to find or configure it through php.ini.

phperror-handling

PHP Error Reporting and Displaying Errors in the Browser

Learn how PHP error_reporting and display_errors work, why errors appear in logs but not the browser, and how redirects can hide PDO exceptions.

phpdebuggingwarnings

Page 5 of 7 - 136 questions