0

I have this url in a string. This is not the current page URL, but it's in a string store for me to access.

$query_string = 'Itemid=364&option=com_easyblog&id=2&view=entry';

I know we can use $_GET["fname"] to get the valued of option and id etc if it's in the URL. But I don't know how to look for the option value if the url is in a string.

I tried strpos($query_string, 'com_easyblog') != FALSE to see if com_easyblog exists in the URL, it works fine. But When it come to checking the id I'm stuck. Can you guys help?

1

2 Answers 2

2

This is probably what you're looking for http://php.net/manual/en/function.parse-str.php

Sign up to request clarification or add additional context in comments.

Comments

2

You want to parse query string (parse_str function)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.