Is there an easy way to compare arrays? See the asterisks.
See the line with the asterisks.
I have an array of file names from a directory in $file.
All these files should have the first 11 column names.
They can have more than that but they have to have the first 11 column names.
foreach ($file as $val){
$hdrArray=("myfield1,myfield2,myfield3,myfield4,myfield5,myfield6,myfield7,myfield8,myfield9,myfield10,myfield11)
if (($fh = fopen($target_path, 'r+'))!== FALSE ){
while (($res = fgets($fh, ",")) !== FALSE) {
if ($res[1]==($hdrArray)==false){ *******
echo " <bold>The header in $file is wrong. \n</bold>";
exit;}
$sData= " ' ". implode( " ', ' ", $res). " ' ";
$sData=htmlspecialchars($sData);
}//end while
$row++ ;
}//end if
fclose($fh);
thanks