TodayTools

PHP flashcards

The server language behind WordPress and a huge share of the web.

Donate
Beginner friendly, starts from zero
Section
How to study
0
PHPStart from zero · 1 of 11

What is PHP, in one plain sentence?

PHP is a programming language that runs on a web and builds the web page a visitor asks for, often using data from a .

PHP cooks pages on the .
Show again
11 left
Got it

Tap to turn over. Swipe right if you know it, left to see it again.

All topics

What you will learn

  1. Start from zero

    • What PHP is and why it exists4 cards
    • Key words4 cards
    • Getting ready3 cards
  2. Core basics

    • Running PHP2 cards
    • Variables and strings3 cards
    • Control flow2 cards
    • Functions2 cards
    • Arrays3 cards
    • Forms and requests2 cards
    • Classes2 cards
  3. Next steps

    • Modern types and design4 cards
    • Composer and autoloading2 cards
    • Databases2 cards
    • Security3 cards
    • Building APIs2 cards
    • Testing and quality3 cards
  4. Go deeper

    • Engine and performance5 cards
    • Memory and internals2 cards
    • Concurrency and long-running PHP2 cards
    • Security in depth3 cards
    • Modern PHP features3 cards
    • Production and upgrades2 cards

Final test and certificate

10 questions drawn fresh from the whole topic, about 15 minutes. Sign in, score 80% or more and get a free certificate with your name and a public check link anyone can open, such as an employer or a teacher. Not signed in? Try a practice test from the cards.

Take the final test

About these cards

  • Reviewed 26 October 2026
  • CoversPHP 8.5PHP 8.4
How these cards are made

PHP at a glance

PHP is a programming language that runs on web servers to build pages and APIs, and it powers WordPress and a large part of the web.

Like a restaurant kitchen behind the counter: the visitor orders a page, PHP cooks it fresh on the server with the right data, and sends back a finished plate of HTML.

Words you will meet

Server
A computer that waits for requests and sends back web pages
Request
A message from a browser asking the server for a page or data
Variable
A named box that holds a value; in PHP its name starts with $
Function
A named set of steps that takes inputs and gives back a result
Array
A list or a set of labelled values kept in one variable
Class
A blueprint for a kind of thing, like a customer or an order
Database
An organised store of data, like customers and orders, that PHP can read and write
Composer
PHP's tool that downloads ready-made packages for your project

The steps

  1. 1. Start from zero (11 cards): What PHP is, how a page is served and the words you need.
  2. 2. Core basics (16 cards): Running PHP, types, strings, control flow, functions, arrays, forms and classes.
  3. 3. Next steps (16 cards): Enums, property hooks, Composer, PDO, security, JSON APIs, testing and PHP 8.5.
  4. 4. Go deeper (17 cards): Request model, OPcache, FPM tuning, memory, fibers, queues, security and upgrades.
All 11 cards in Start from zero
What is PHP, in one plain sentence?
PHP is a programming language that runs on a web server and builds the web page a visitor asks for, often using data from a database.
Why was PHP created?
In 1994 Rasmus Lerdorf wrote small tools to track visits to his home page. They grew into PHP, a simple way to mix code with HTML so pages could change for each visitor.
Where do you meet PHP in daily life?
Blogs and news sites on WordPress, many online shops (WooCommerce, Magento), Wikipedia, and countless school, clinic and small business websites.
What happens when you open a PHP page?
Your browser sends a request. The server runs the PHP code, which may read a database, and sends back plain HTML. You never see the PHP itself.
What is a server, and what is a request?
A server is a computer that waits for visitors. A request is a visitor's message, like 'show me the cart page'. PHP answers each request.
Why do PHP variables start with $?
The $ marks a named box, like $name or $total. It makes variables easy to spot inside text and HTML.
What is an array in PHP?
One box holding many values: a simple list like a shopping list, or labelled values like a contact card with name and phone.
What is Composer?
PHP's helper that downloads and updates ready-made packages, like a PDF maker or an email sender, so you do not write them yourself.
What do you need before you start PHP?
Basic HTML helps a lot. Install PHP (or a bundle with a web server and database), any code editor, and you can run a page with PHP's built-in server.
What does a first PHP page look like?
PHP code goes between <?php and ?> inside an HTML page. echo sends text into the page.
After this topic, what will you be able to do?
Build dynamic pages and APIs, work safely with forms and databases, read WordPress and Laravel code, and handle PHP interview questions.
PHP cheatsheet

Run and tools

  • php -S localhost:8000 -t public Built-in dev server
  • php -l file.php Syntax check
  • php -m List loaded extensions
  • composer require vendor/pkg Add a package
  • composer install --no-dev -o Production install
  • composer audit Check for known vulnerabilities
  • vendor/bin/phpunit Run tests

Syntax

  • declare(strict_types=1); No silent type conversion
  • $a ?? $default Fallback if null or missing
  • $a?->b Null-safe call
  • match ($x) { 1, 2 => 'a', default => 'b' } Strict, returning switch
  • fn($x) => $x * 2 Arrow function
  • strlen(...) First-class callable
  • $x |> trim(...) |> strtoupper(...) Pipe operator (8.5)

Arrays

  • $list[] = $x Append
  • array_map(fn, $a) Transform each
  • array_filter($a, fn) Keep matches
  • usort($a, fn($x, $y) => $x <=> $y) Sort by rule
  • in_array($x, $a, true) Strict contains
  • array_find / array_any / array_all Search helpers (8.4)
  • [...$a, ...$b] Merge with spread

Security

  • htmlspecialchars($s) Escape output for HTML
  • $pdo->prepare(...)->execute([...]) Safe SQL
  • password_hash($p, PASSWORD_DEFAULT) Store a password
  • password_verify($p, $hash) Check a password
  • bin2hex(random_bytes(32)) Secure random token
  • hash_equals($known, $given) Timing-safe compare

Classes

  • public function __construct(private int $x) {} Constructor promotion
  • public readonly string $id Write-once property
  • public private(set) string $s Public read, private write (8.4)
  • enum Status: string { case Paid = 'paid'; } Backed enum
  • Status::tryFrom($v) Enum from value or null
  • clone($obj, ['x' => 1]) Copy with changes (8.5)
Donate