I have a HTML form for entering a file and the php validates if the file entered is a xls file through the extension .xls !! Now If a user renames a image or script file say abc.jpeg to abc.xsl the file wont be validated by the php code ! How can i validate if its truly a xls file irrespective of the extension? Php code for validation
if(in_array($file_ext,$expensions)=== false)
{
echo "extension not allowed, please choose a .xls file.";
exit();
}