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 6690563
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:39:05+00:00 2026-05-26T05:39:05+00:00

Ok, so I have a string like so: index.php?page=test2;sa=blah And I need only to

  • 0

Ok, so I have a string like so:

index.php?page=test2;sa=blah

And I need only to grab what gets returned using $_GET['page'], so it will return, test2 in this case. BUT page MUST be defined DIRECTLY after index.php? before it can return an actual string. How do I do this? I just need the same results returned from a $_GET for the page variable. I can also have just this:

index.php?page=blah

Should return blah

or this:

index.php?page=anything&sa=blah

Returns anything

or this:

index.php?action=blah;page=2

Returns empty string, cause this is NOT directly after index.php?

or basically any url, but it needs to grab the variable of page if it exists, only after index.php?. And sometimes page might not even exist at all, in this case, an empty string should be returned.

How can I do this? I am not browsing to the URL in my browser, so, don’t think $_GET will work, but it needs to simulate and return the EXACT same results that $_GET will return in the browser, but only if page is defined directly after index.php?

  • 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-26T05:39:05+00:00Added an answer on May 26, 2026 at 5:39 am

    Please use following code:

    function get($name, $url) {
       $src = parse_url($url);
       $src = $src['query'];
       parse_str($src, $tag);
       return $tag[$name];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a url, like an string http://www.php.net/index.php?page=mypage&keywords=mykeyword&title=mytitle I want to grab mykeyword as
I have pages like index.php?key=toplist&list=magic So if om on that page for example, i
I have the following page: www.domain.com/index.php?route=information/contact and I'd like to rewrite it so that
i have this URI. http://localhost/index.php?properties&status=av&page=1 i am fetching basename of the URI using following
i have a string like this one: $string = some text http://dvz.local/index/index/regionId/28 http://stuff.kiev.ua/roadmap_page.php http://192.168.3.192/roadmap_page.php
I have string like \LESSING\root\cimv2:Win32_UserAccount.Domain=LESSING,Name=Admin How to convert it to LESSING\Admin using Framework?
I have string like {param1=foo}{param2=bar}hello world! I need to extract array of tuples (paramName,
I have horrible URLs like this: http://example.com/subfolder/index.php?a=1&b=1&token=8d519decbe60db44154b1fbc8c553ac4 I am trying to make it look
I have string like this : <input name=my_name id=my_id value=my_value class=my_class /> I would
I have string like this: G:\Projects\TestApp\TestWeb\Files\Upload\file.jpg How can I remove all text before Files

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.