Re: $_POST into a formatted string, help!

From: Date: Wed, 03 Jul 2002 14:20:11 +0000
Subject: Re: $_POST into a formatted string, help!
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-105193@lists.php.net to get a copy of this message
Oh man I hope you don't shoot yourself when you realize how easy this is.. foreach ($_POST as $key => $val) {
    $str .= "&$key=$val";
} Then just crop the first char off and there you go.
Even easier, though maybe requiring a tiny bit extra memory to deal with the array: $arr = array(); foreach ($_POST as $key => $val) { $arr[] = $key . '=' . $val; } $str = implode('&', $arr); Erik ---- Erik Price Web Developer Temp Media Lab, H.H. Brown pricee@hhbrown.com

« previous php.general (#105193) next »