Get value from textboxes.

_POST has $no_elements elements:"; echo "

Manual capture of value:

"; $text1 = filter_input(INPUT_POST, 'text1'); echo $text1."
\n"; $text2 = filter_input(INPUT_POST, 'text2'); echo $text2."
\n"; echo "

Use no_elements to capture value:

"; for ($i=1; $i<=($no_elements-1); $i++) { $temp_name = 'text'.$i; echo $temp_name." = "; $temp_number = filter_input(INPUT_POST, $temp_name); echo $temp_number; echo "
\n"; $number_array[] = $temp_number; //push value to array } //end for echo "

Print values from array:

"; $sum = 0; for ($i=0; $i\n"; $sum = $sum + $number_array[$i]; } //end for echo "The sum of this array = $sum
\n"; echo "

Print value using associative array:

"; foreach ($_POST as $p_name => $p_value) { if ($p_name !== "Submit1") { echo "$p_name = $p_value
\n"; } //end if } //end for ?>