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?

mickmackusa
49k13 gold badges97 silver badges163 bronze badges
asked Dec 2, 2012 at 4:37
1

2 Answers 2

2

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

answered Dec 2, 2012 at 4:43
2

You want to parse query string (parse_str function)

answered Dec 2, 2012 at 4:44

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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.