difference in "IF" of pdf, DOC, PPTX files [closed]

-2

I need to create an "if" to differentiate pdf files from doc and pptx in php.

Thanks

    
asked by MiguelM 10.10.2017 в 21:03
source

1 answer

0

You could do something like this

$tipo_archivo = pathinfo('ruta/de/tu/archivo');

if($tipo_archivo['extension'] == 'pdf'){
    echo "el archivo es un PDF"
}

if($tipo_archivo['extension'] == 'doc'){
    echo "el archivo es un Documento"
}

if($tipo_archivo['extension'] == 'pptx'){
    echo "el archivo es un Documento de Power Point"
}

I hope it serves you, regards

    
answered by 10.10.2017 / 21:10
source