I hope this isn't too vague a question, but here goes.
I want to loop through the values stored in the textfield_array and see if they match any keys in the $_POST array. If they do I want to assign them to the an_arrayarray.
It seems that there are no matches, although I know that there should be! Here's my code:
<?php
$an_array = array();
$textfield_array = array(
'item_no', 'button_text', 'text_field', 'drop_down_title'
);
foreach( $textfield_array as $textfield ){
if( in_array( $textfield, $_POST ) ){
$an_array[$textfield] = $_POST[$textfield];
}
}
?>
Am I being daft? Or misunderstanding how the $_POSTarray works?!