abrahamgarcia27 Posted November 16, 2013 Share Posted November 16, 2013 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 More sharing options...
dalecosp Posted November 16, 2013 Share Posted November 16, 2013 This usually indicates that the POST array doesn't have the structure that you expect it to. What does print_r($_POST); at the top of the script give you? Link to comment https://forums.phpfreaks.com/topic/283950-post-into-an-array/#findComment-1458484 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.