Mundo Posted September 22, 2010 Share Posted September 22, 2010 I've created a quotation form and some of the values are passed in an array (i've used jQuery to clone the form for necessary fields). I currently have the following: foreach ($_GET as $var => $value) { // Stick POST names into "$var" and the values into "$value" if(!is_array($value)) { // Test us $value contains and array (horse detials are an array everything else isn't) echo "<strong>$var:</strong> $value<br />\n"; // Echo out the customer detials and additional information } else { // If the value is an array.... } } } But i'm kind of stuck for ideas on how to echo out the rest of the details in the way i need it... There are 6 arrays, I know I can do something like: $array = $_GET['quote-details']; foreach($array as $detail) { echo "<strong>Detail:</strong> $detail<br />\n"; } But I have to do this 6 times... I also want to sort these details in a logical manor, but again im a little stuck. So instead of it exporting like: Detail1 Detail1 Detail1 Detail2 Detail2 Detail2 etc, I want it to export as: Detail1 Detail2 Detail1 Detail2 If anyone can give me any help I would be VERY grateful! Regards, Mundo Link to comment https://forums.phpfreaks.com/topic/214083-array-from-a-form/ Share on other sites More sharing options...
Adam Posted September 22, 2010 Share Posted September 22, 2010 It's not clear how your data is structured. Could you print_r() the $_GET array and copy/paste (from the source) the output? Link to comment https://forums.phpfreaks.com/topic/214083-array-from-a-form/#findComment-1114002 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.