Getting values from a query string

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • c1pkw
    New Member
    • May 2007
    • 6

    Getting values from a query string

    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.
  • pbmods
    Recognized Expert Expert
    • Apr 2007
    • 5821

    #2
    Methinks you'll be liking parse_str.

    Comment

    Working...