PHP

Receiving URL Query Parameters in PHP

A memo about how to receive URL query parameters in PHP. Uses the isset function and $_GET variable. An example that returns "1" when <code>&black=true</code> is defined...

Shou Arisaka
1 min read
Oct 16, 2025

A memo about how to receive URL query parameters in PHP. Uses the isset function and $_GET variable.

An example that returns โ€œ1โ€ when &black=true is defined

<?php
if (isset($_GET['black'])) {
    // echo $_GET['black'];
        if ($_GET['black'] == "true") {
            echo "1" ;
        }
} else {
    // Fallback behaviour goes here
}

?>

Share this article

Shou Arisaka Oct 16, 2025

๐Ÿ”— Copy Links