How do I get Variables out of a string?

From: Date: Fri, 16 Mar 2001 16:16:24 +0000
Subject: How do I get Variables out of a string?
Groups: php.general 
Request: Send a blank email to php-general+get-44272@lists.php.net to get a copy of this message
Hello! I have been bashing my head trying to figure this out, and I'm hoping somebody can show me the correct way to do this: A PGP signed set of variables is passed to our URL via GET. I use HTTP_GET_VARS to grab the PGP string, which is contained in a variable called "trnResponse". I run that through pgpv to end up with the raw string, which I store in a variable called $rawstring The string looks like: trnId=10000019&messageId=1&messageText=Approved&authCode=&trnDate=3%2F16%2F2 001+8%3A07%3A14+AM&trnOrderNumber=435643 That's where I get confused about the best way to pull the variables out of the string. I was using something like: $thearray = explode ("&", rawurldecode($rawstring)); (this still leaves me with "+" in some places, but I can use str_replace to get rid of them) I was exploding on "&", but that leaves me with an array with things like trnId=10000019 in each "cell" It does explode properly, but now, how do I pull these things out of the array and get them defined as variables?? Or...do I even need to put them into the array in the first place? THANK YOU for any help someone might be able to provide!! -- Shawn Pritchard

« previous php.general (#44272) next »