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); Quote Link to comment 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? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.