RE: [PHP] How do I get Variables out of a string?

From: Date: Fri, 16 Mar 2001 16:19:44 +0000
Subject: RE: [PHP] How do I get Variables out of a string?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-44276@lists.php.net to get a copy of this message
urldecode it first. Then explode it. Cal http://www.calevans.com -----Original Message----- From: Shawn Pritchard [mailto:shawn@webexceed.com] Sent: Friday, March 16, 2001 10:16 AM To: php-general@lists.php.net Subject: [PHP] How do I get Variables out of a string? 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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#44276) next »