Codice PHP:
$formati_consentiti = array(
'jpg',
'jpeg',
'gif',
'png');
$ext = end(explode('.', $_FILES['image']['name']));
if(!in_array($ext, $formati_consentiti))
{
$msg = 'Il file non è del tipo consentito';
}
Codice PHP:
$formati_consentiti = array(
'jpg',
'jpeg',
'gif',
'png');
$ext = end(explode('.', $_FILES['image']['name']));
if(!in_array($ext, $formati_consentiti))
{
$msg = 'Il file non è del tipo consentito';
}