Questions
PHP questions
Choose a question page, learn the concept, then test your understanding with a quiz.
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.
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.
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.
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.
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.
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.
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.
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.
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.
How to Get a YouTube Video Thumbnail in PHP Using the YouTube API
Learn how to get a YouTube video thumbnail from a YouTube URL in PHP using the YouTube Data API and simple thumbnail URLs.
How to Get the Client IP Address in PHP
Learn how to get a client IP address in PHP, when to use REMOTE_ADDR, and how to safely handle proxies and logging.
How to Get the Current Year in PHP for Dynamic Copyright Footers
Learn how to get the current year in PHP and use it in a dynamic copyright footer that updates automatically every year.
How to Get the First Element of an Array in PHP
Learn how to get the first element of a PHP array without using array_shift or passing by reference, with examples and common pitfalls.
How to Hash Passwords with bcrypt in PHP
Learn what bcrypt is in PHP, how password_hash and password_verify work, and the correct way to store passwords securely.
How to Parse and Process HTML/XML in PHP
Learn how to parse HTML and XML in PHP using DOMDocument, XPath, and SimpleXML to extract data safely and clearly.
How to Prevent SQL Injection in PHP
Learn how to prevent SQL injection in PHP using prepared statements, parameter binding, input validation, and safe database APIs.
How to Redirect in PHP with the header() Function
Learn how to redirect users in PHP using header(), including syntax, login protection, common mistakes, and real examples.
How to Return JSON from a PHP Script
Learn how to return JSON from PHP correctly using json_encode, proper headers, and practical examples for APIs and AJAX responses.
How to Sanitize User Input in PHP for SQL Injection and XSS
Learn how to sanitize and validate user input in PHP to prevent SQL injection and XSS while safely allowing selected HTML tags.
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.
Page 1 of 2 - 32 questions