- in_array: documentation ( source)
<?php
$error = array();
$allowedExts = array("jpg", "jpeg", "gif", "png");
if (!in_array($_FILES["newsthumb"]['type'], $allowedExts) || !in_array($_FILES["newsmain"]['type'], $allowedExts)) {
$error[] = "One/Both of the files are too large.<br>";
}