Facebook Twitter Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    You are at:Home»Programming»PHP»PHP – Get Query String Values ($_SERVER['QUERY_STRING'])

    PHP – Get Query String Values ($_SERVER['QUERY_STRING'])

    By RahulMay 10, 20151 Min Read

    A Query String is a part of url accessed through web browser. Using query string we passed the argument to web pages. Using this article we will help you to how to fetch values of query string using php script.

    Advertisement

    Fetch Query String:

    We can fetch url Query String values from $_SERVER array like following example.

    <?php
    
    $qs = $_SERVER['QUERY_STRING'];
    
    ?>
    

    Parse Query String:

    Now we can parse the query string and store it to an array using parse_str function.

    <?php
    
    parse_str($qs, $qs_arr);
    print_r($qs_arr);
    
    ?>
    

    PHP Query String url
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp

    Related Posts

    Installing PHP on Pop!_OS

    How to Install PHP 8.x on Pop!_OS

    Managing Dependencies with Composer: A Beginner’s Guide

    CodeIgniter Remove index.php Using .htaccess

    Add A Comment

    Leave A Reply Cancel Reply

    Advertisement
    Recent Posts
    • Error: EACCES: permission denied, scandir (Resolved)
    • How To Install Python 3.11 on Ubuntu 22.04 / 20.04
    • How to Install Python 3.11 on Amazon Linux 2
    • An Introduction to the “./configure” Command: Compiling Source Code in Linux
    • How to Install PHP 8.x on Pop!_OS
    Facebook Twitter Instagram Pinterest
    © 2023 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.