Jump to content

Getting values from a query string


Recommended Posts

Hi there,

 

I've used the cUrl library to return a query string from a remote server to a variable.  The

 

query string looks a bit like this:

 

...php?message_id=a1&recipient=unit1&sendday=fri

 

At the moment, the whole of this query string is contained in a single variable ($qstring) so if I print $qstring, "message_id=a1&recipient=unit1&sendday=fri" will be sent to the browser.

 

 

Can anyone tell me how to break the values "a1", "unit1" and "fri" into individual variables

 

so that I can start using them in the rest of my code like this:

 

$message_id = "a1";

$recipient = "unit1";

$sendday = "fri";

 

I'd like to achive this in the same php script rather than sending it to another page to GET

 

the elements of the query string.

 

Thanks in advance,

Paul.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.