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.

phpsecuritypdosql-injection

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.

phparrayspdoprepared-statement

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.

phpmysqlencodingcollation

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.

phpjavascriptclient-sideserver-side

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.

phpdateformatting

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().

phpstringcastingboolean

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.

phparrays

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.

phpcurlpostman

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.

phparraysobjectcasting

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.

phphtmlcsspdf

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.

phpstringcastingtype-conversion

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.

phparraysmultidimensional-arrayfilter

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.

phpdate

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.

phpeasyphp

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.

phpmysqllaraveldatabase

Fixing dyld Library Not Loaded Errors for PHP on macOS Homebrew

Learn why PHP fails with a missing icu4c dylib after Homebrew installs and how to diagnose and fix broken dynamic library links on macOS.

phpnode.jsmacoshomebrew

Format MySQL DATETIME Values in PHP with DateTime

Learn how to parse a MySQL DATETIME in PHP and format it as mm/dd/yy with a 12-hour time and AM/PM safely and clearly.

phpmysqldatetime

Format Numbers to Two Decimal Places in PHP

Learn how to format a PHP string number to two decimal places using number_format, rounding, and safe numeric conversion.

phpformattingnumbersrounding

Generate Secure Unique Verification Tokens in PHP

Learn how to create secure, unique alphanumeric verification tokens in PHP using random_bytes, database constraints, expiry times, and safe links.

phpstringrandomuniqueidentifier

Get a File Extension in PHP with pathinfo()

Learn how to get a filename extension in PHP using pathinfo(), why explode() returns an array, and how to validate uploaded images safely.

phpfile-extension

Page 1 of 7 - 136 questions

PreviousNext