Questions

PHP questions

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

How to Check Whether a PHP Session Has Started

Learn how to safely detect and start PHP sessions, avoid duplicate session_start() calls, and handle $_SESSION correctly in PHP.

phpsessionsession-variables

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 Check if a String Starts With a Prefix in PHP

Learn how to check whether a string starts with a specific prefix in PHP, with simple examples, common mistakes, and practical use cases.

php

How to Check if an Array Is Empty in PHP

Learn how to check whether an array is empty in PHP, including empty strings, exploded values, and safe patterns for real codebases.

phparraysis-empty

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 Copy Arrays in PHP: Assignment, References, and Safe Copies

Learn how PHP array copying works, including assignment, references, and safe ways to copy arrays between variables and objects.

phparrayscopy

How to Create Custom Helper Functions in Laravel

Learn how to create globally available custom helper functions in Laravel for reusable text formatting and cleaner Blade views.

phplaravellaravel-8laravel-blade

How to Create a Directory If It Does Not Exist in PHP and WordPress

Learn how to check whether a folder exists and create it safely in PHP and WordPress, including practical examples and common mistakes.

phpwordpressdirectory

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 Detect the First and Last Iteration in a foreach Loop in PHP

Learn how to detect the first and last iteration in a PHP foreach loop using counters, array keys, and practical beginner-friendly examples.

phploopsforeach

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 "Cannot Use Object of Type stdClass as Array" in PHP json_decode()

Learn why json_decode() returns stdClass objects in PHP and how to correctly access values as objects or associative arrays.

phpjson

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 2 of 6 - 112 questions