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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T23:57:23+00:00 2026-06-17T23:57:23+00:00

Just take a look at this url, and you will know what I mean.

  • 0

Just take a look at this url, and you will know what I mean.

https://www.google.com/search?q=site%3Aphpjs.org&q=date

And when I go to that url, the search term in google’s search bar is site:phpjs.org date.

How does Google ‘morph’ the two parameters together, and how would one do it in 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-06-17T23:57:24+00:00Added an answer on June 17, 2026 at 11:57 pm

    Instead of encoding the space, Google uses the same q variable to accomplish the same thing.

    Unfortunately, PHP doesn’t have the built-in ability to do this, because successive occurrences of the same query string parameter will overwrite the first one, unless the [] suffix is used.

    You would need something like this:

    $params = array();
    foreach (explode('&', $_SERVER['QUERY_STRING']) as $param) {
        list($name, $value) = explode('=', $param, 2);
        $params[] = array(urldecode($name) => urldecode($value));
    }
    

    Contents of $params:

    array(
        array('q' => 'site:phpjs.org'),
        array('q' => 'date'),
    );
    

    Alternatively, you can change the loop body to this:

    $params[urldecode($name)][] = urldecode($value);
    

    That will change $params to:

    array('q' => array('site:phpjs.org', 'date'));
    

    Which will make it easier to just do:

    join(' ', $params['q']);
    // "site:phpjs.org date"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Take a look to this function please function CheckHost() { $url = parse_url($_SERVER['HTTP_REFERER']); $host
I currently have lots of URLs that look like this: http://www.domain.com/classes-dallas-tx.html I need to
Let's take these URLs as an example: http://www.youtube.com/watch?v=8GqqjVXhfMU&feature=youtube_gdata_player http://www.youtube.com/watch?v=8GqqjVXhfMU This PHP function will NOT
Take a look at the standard URL from imgur website: http://i.imgur.com/zx24u.jpg I was wondering
Hi could some one please take a look at this and let me know
I've just downloaded Twitter Bootstrap to take a look at an implementation of LESS.
Is there an easy (therefore quick) way to accomplish this? Basically just take some
** EDIT ** Nevermind, just needed to take out the parens... I get this
Really struggling to figure this out. Just trying to take in data from php
I just want a function that can take 2 parameters: the URL to POST

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.