Questions
PHP questions
Choose a question page, learn the concept, then test your understanding with a quiz.
Are PDO Prepared Statements Enough to Prevent SQL Injection in PHP?
Learn how PDO prepared statements prevent SQL injection in PHP, what they protect, and the mistakes that still leave MySQL apps vulnerable.
Can You Bind an Array to an IN Clause in PHP PDO?
Learn how PDO handles placeholders in IN() clauses, why arrays cannot be bound directly, and the safe PHP pattern to build dynamic queries.
Choosing the Right MySQL Collation for PHP and UTF-8
Learn how MySQL character sets and collations work with PHP, and how to choose a practical UTF-8 setup for web applications.
Client-Side vs Server-Side Programming Explained with PHP and JavaScript
Learn the difference between client-side and server-side programming, why PHP cannot read JavaScript variables directly, and how data flows between browser and server.
Convert Date Formats in PHP: From yyyy-mm-dd to dd-mm-yyyy
Learn how to convert date formats in PHP using DateTime, strtotime, and date() with clear examples and common mistakes.
Convert String to Boolean in PHP Safely
Learn why settype() returns true, how PHP casts strings to booleans, and how to safely parse "true" and "false" with filter_var().
Convert a PHP Object to an Associative Array
Learn how to convert a PHP object to an associative array, including quick methods, recursion, pitfalls, and practical examples.
Convert a Postman Request to cURL and PHP cURL
Learn how to convert a Postman POST request into a cURL command and use the same request in PHP cURL with headers and body.
Convert an Array to an Object in PHP
Learn how to convert PHP arrays to stdClass objects with casting, understand shallow versus recursive conversion, and access object properties safely.
Converting HTML and CSS to PDF in PHP: Core Concepts, Limits, and Practical Approaches
Learn how HTML-to-PDF conversion works in PHP, why CSS support varies, and how to choose practical approaches for reliable PDF output.
Converting an Integer to a String in PHP
Learn how to convert an integer to a string in PHP using casting, interpolation, and functions with examples, mistakes, and practice.
Creating and Initializing Objects in PHP
Learn why PHP shows “Creating default object from empty value” and how to initialize stdClass or domain objects safely before properties.
Filter Associative Array Keys with an Allowed List in PHP
Learn how to keep only allowed keys in a PHP associative array using array_intersect_key(), array_flip(), and key-aware filtering.
Find a Row Key by Column Value in a PHP 2D Array
Learn how to find the first row key matching a uid in a PHP two-dimensional array, with loops, array_search(), safety checks, and examples.
Find the Last Day of a Month in PHP
Learn how to find the last day of any month in PHP with DateTimeImmutable, date formats, leap years, time zones, and practical examples.
Find the PHP CLI php.ini File and Enable Extensions
Learn how to identify the php.ini used by PHP CLI, verify the active PHP executable, and enable extensions such as pdo_mysql correctly.
Fix Call to Undefined Function curl_init() in PHP
Learn why PHP reports “Call to undefined function curl_init()”, how to enable the cURL extension, verify it works, and handle HTTP requests safely.
Fix Laravel Mcrypt PHP Extension Errors on macOS
Learn why Laravel reports a missing Mcrypt PHP extension on macOS, especially when Artisan CLI and web PHP use different configurations.
Fix PDOException SQLSTATE[HY000] [2002] in Laravel PHP
Learn why Laravel PDO reports SQLSTATE[HY000] [2002] No such file or directory and how to fix MySQL socket, host, and config issues.
Fix “No Application Encryption Key Has Been Specified” in Laravel
Learn why Laravel reports a missing application encryption key and how to generate, configure, and safely manage APP_KEY in your .env file.
Page 1 of 9 - 162 questions