```
$resultUpdate = Nemesis::select("*", $table, "id = '{$id}'");
if (!$resultUpdate) {
    self::show_error(QUERY_ERROR);
} elseif ($resultUpdate->num_rows > 0) {
    $out .= '<div class="form-desc">' . $formDesc . '</div>';
} else {
    self::show_error(QUERY_EMPTY);
}
$array = array_values($array);
print_r($array);
$out .= '<form action="' . $_SERVER['PHP_SELF'] . '?id=' . $id . '&table=' . $table . '" method="post" class="form-horizontal" ' . $formAppend . '>';
while ($row = $resultUpdate->fetch_assoc()) {
    foreach ($row as $fieldname => $value) {
        if (in_array($fieldname, $array)) {
            $out .= generateInputField($fieldname, $value);
        }
    }
    foreach ($row as $fieldname => $value) {
        if (in_array($fieldname, $array)) {
            $out .= generateTextarea($fieldname, $value, $cke);
        }
    }
    foreach ($row as $fieldname => $value) {
        if (in_array($fieldname, $array)) {
            $out .= generateImgField($fieldname, $value);
        }
    }
}
$arr = array("last_modified"=>"input", "published"=>"input", "content"=>"textarea");
echo $automate->createArrayForm('projects', 'update', 'Some form desc', '178514825', $arr, true);

```

Right now all fields are outputting in every `foreach` when only `inputs` should output in the `generateInputField` section for example. I know this is because I need to check if the fieldtype (input, textarea) key matches with one of the values marked as `input` or `textarea` for values of the `$fieldname`. But I am not sure how.

I am pretty sure I have to filter the array so only values with `input` go into a separate array like `arrayInput` in which I can use as the second argument in `in_array`.