Hallo romy.
M.E. kann man den wahren Inhalt nur über reinschauen in die Datei realisieren. Achtung keine gesicherte Aussage, ich habe es nicht geprüft, aber mir scheint, als stünde in PDF's am Anfang immer "%PDF". Das könntest du natürlich auch als Kriterium nehmen.
Ja, das ist vermutlich das verlässlichste Kriterium, da dies sogar in der PDF-Referenz erwähnt wird:
The first line of a PDF file is a header identifying the version of the PDF specification to which the file conforms. For a file conforming to PDF version 1.5, the
header should be
%PDF-1.5
Notfalls könnte auch noch „file“ (nein, nicht die PHP-Funktion) behilflich sein. (Ausgeführt über exec und Konsorten) Auch damit kann recht eindeutig der tatsächliche Dateityp ungeachtet des Dateinamens ermittelt werden.
Einen schönen Mittwoch noch.
Gruß, Ashura
sh:( fo:} ch:? rl:( br: n4:~ ie:{ mo:| va:) de:> zu:} fl:( ss:) ls:[ js:|
„It is required that HTML be a common language between all platforms. This implies no device-specific markup, or anything which requires control over fonts or colors, for example. This is in keeping with the SGML ideal.“
[HTML Design Constraints: Logical Markup]