dennismonsewicz Posted March 4, 2010 Share Posted March 4, 2010 I have a web form and upon submission I append all the $_POST values to an array but it is capturing the submit $_POST value... Is there anyway to strip that out of the array? Here is my code so far: $array = array(); foreach($_POST as $k => $v) { unset($_POST[array_search("submit", $_POST)]); $array[$k] = $v; } echo '<pre>'; print_r($array); echo '</pre>'; When I look at my results I am still seeing the submit post in the array Link to comment https://forums.phpfreaks.com/topic/194147-stripping-submit-from-array/ Share on other sites More sharing options...
dennismonsewicz Posted March 4, 2010 Author Share Posted March 4, 2010 Nevermind, figured it out! $array = array(); foreach($_POST as $k => $v) { $array[$k] = $v; } unset($array['submit']); echo '<pre>'; print_r($array); echo '</pre>'; Link to comment https://forums.phpfreaks.com/topic/194147-stripping-submit-from-array/#findComment-1021496 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.