\n"; echo "".$pname."
\n"; echo "".$pid."
\n"; foreach ($field_list as $field) { echo "<".$field.">"; echo $field[1]; //var_dump($_POST[$field[0]]); var_dump($field); //echo $_POST['VP']; echo "
\n"; } echo "
\n"; ?> //function// //fid == 3 for parsing the form data. if ($fid == 3) { $xml = new SimpleXMLElement($template); //define the array $form_fields = array(); foreach ($xml->xpath('//Product[ProductNum = '.$pid.']/question') as $question) { array_push($form_fields, $question['name']); } //end foreach return $form_fields; } // end of fid == 3 }