Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 827355
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T03:33:42+00:00 2026-05-15T03:33:42+00:00

I am trying to develop a PHP class which would enable me to get

  • 0

I am trying to develop a PHP class which would enable me to get the query string appended into a url and process it according to the variables passed. How can this be done?

Eg

www.example.com?var1=a&var2=b&var3=c

now I want to get ?var1=a&var2=b&var3=c section and process it based on the variables.

Thanks for your responses

but I want a means by which I can get the whole query string since I wont be sure of the variable names that will be sent into the URL thus the $_GET method wont work properly.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T03:33:43+00:00Added an answer on May 15, 2026 at 3:33 am

    If you want access to the URL parameters as a string you can use this:

    $_SERVER['QUERY_STRING']
    

    But, I’m not sure how that would be any more useful than $_GET. You said:

    I wont be sure of the variable names

    You can iterate through the $_GET array with a foreach loop:

    foreach ($_GET as $key => $val) {
        echo $key . ": " . $val;
    }
    

    However… if you’re talking about an arbitrary URL (not necessarily the one which was requested), then the above methods won’t work since they obviously won’t be in $_GET. Instead you can use parse_url

    $url = 'http://username:password@hostname/path?arg=value#anchor';
    
    print_r(parse_url($url));
    
    echo parse_url($url, PHP_URL_QUERY);
    

    Output:

    Array
    (
        [scheme] => http
        [host] => hostname
        [user] => username
        [pass] => password
        [path] => /path
        [query] => arg=value
        [fragment] => anchor
    )
    arg=value
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm a mac novice and trying to get a developer setup to develop php
I am currently trying to develop a PHP application in which my server downloads
I'm trying to develop a Flex Mobile / PHP application, and I'm running into
I'm trying to develop a simple php based schedule ... This is my database
I'm trying to develop a Facebook application, and I have uploaded my index.php file,
Okay, here's what I'm trying to do: I'm trying to use PHP to develop
Im trying to develop my first ASP.NET MVC web app and have run into
I am trying to develop an application for my localhost on which I can
I was trying to develop a video management software for which I was evaluating
I need to develop a PHP class to communicate with Apple servers in order

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.