Questions

PHP questions

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

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

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

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

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

How PHP foreach Actually Works with Arrays

Learn how PHP foreach works internally, including array copies, internal pointers, by-value vs by-reference behavior, and common pitfalls.

phploopsforeachiteration

How to Calculate the Difference Between Two Dates in PHP

Learn how to calculate the difference between two dates in PHP using DateTime and DateInterval, with examples and common mistakes.

phpdatetimedatediff

How to Check String Prefixes and Suffixes in PHP

Learn how to check whether a string starts or ends with specific text in PHP using simple functions and practical examples.

phpstring

How to Check if a PHP Array Is Associative or Sequential

Learn how to detect associative vs sequential arrays in PHP, with clear examples, edge cases, and practical patterns for real code.

phparrays

How to Check if a String Contains a Word in PHP

Learn how to check whether a PHP string contains a specific word using strpos and str_contains with clear examples and common mistakes.

phpstringsubstringcontains

How to Convert a String to a Number in PHP

Learn how to convert strings like '2' or '2.34' to numbers in PHP using casting, numeric checks, and safe conversion patterns.

phpcastingtype-conversion

How to Delete an Array Element by Value in PHP

Learn how to remove an array element by value in PHP using array_search and unset, with examples, pitfalls, and practical patterns.

phparrays

How to Delete an Element from an Array in PHP

Learn how to remove array elements in PHP using unset, array_filter, and reindexing, with examples and common mistakes explained clearly.

phparraysunset

How to Detect HTTP Request Methods in PHP (GET, POST, PUT, DELETE)

Learn how to detect GET, POST, PUT, and DELETE requests in PHP using REQUEST_METHOD, with examples, pitfalls, and real-world usage.

phphttprequest

How to Display PHP Errors in the Browser

Learn how PHP error display works, why blank pages happen, and how to enable useful errors during development safely.

phperror-handlingsyntax-errorerror-reporting

How to Expire a PHP Session After 30 Minutes

Learn how to expire a PHP session after 30 minutes using inactivity timeouts, session checks, and safe logout logic in PHP.

phpsessioncookies

How to Find and Configure php.ini in PHP

Learn where php.ini is located, how PHP loads configuration files, and how to enable extensions like ibm_db2 safely and correctly.

phplinuxphp-ini

How to Find the Number of Days Between Two Dates in PHP

Learn how to calculate the number of days between two dates in PHP using DateTime, diff(), timestamps, and common best practices.

phpdatetime

How to Fix PHP Allowed Memory Size Exhausted Errors When Sending Large XML-RPC Payloads

Learn why PHP memory exhausted errors happen with large XML-RPC requests and how to reduce memory use in PHP and CodeIgniter apps.

phpmemorymemory-limit

How to Fix PHP Parse and Syntax Errors

Learn how to read PHP parse errors, find the real cause, and fix common syntax mistakes with practical examples and debugging steps.

phpparsingdebuggingsyntax-error

Page 1 of 4 - 62 questions

PreviousNext