Jump to content

Array from a form


Mundo

Recommended Posts

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.