Jump to content

Post into an array


abrahamgarcia27

Recommended Posts

I have been trying to save variable into an array, but i cannot seem to make it work i have the following and it does not print the results. 

$myData = array();
						
		foreach ($_POST as $values) {
			$myData[] = array(
				'rep'            => $values['rep'],
				'declared'           => $values['declared'],
				'detail_id' => $values['detail_id']
			);
		}

		print_r($myData);
Link to comment
https://forums.phpfreaks.com/topic/283950-post-into-an-array/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.