83

Answer

Solution:

If you mean you want to parse it from a string you can use parse_url()

$url = "http://website.com/tagged?tag=egg&offset=1";
$parsed = parse_url($url);

var_dump($parsed);

// Result
Array
(
    [scheme] => http
    [host] => website.com
    [path] => /tagged
    [query] => tag=egg&offset=1
)
326

Answer

Solution:

http://php.net/parse_url

$query = parse_url($url, PHP_URL_QUERY);
483

Answer

Solution:

var_dump($_GET);

Using $_GET, you can now use http_build_query():

$getString = http_build_query($_GET);

People are also looking for solutions to the problem: Peek ahead when iterating an array in PHP

Source

Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.