Re: searching non plain text files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> On Dec 14, 2018, at 11:19 PM, Jeffry Killen <jekillen@xxxxxxxxxxx> wrote:
> 
> 
> Can anyone point me to instruction/advice about
> opening and reading files that are not plain text:

Jeffry:

I don’t know if this will help you, but most “honest” files have a header that states what it is.

Try using a hex-editor app and observing the first 10 characters in their headers (i.e., start of the file). For example, a PDF file will state ‘PDF’, a jpg will state ’JFIF’, a rtf file will state ‘rtf’, a zip file will state ‘PK”, a png will state ‘PNG”, and so on.

>From that observation, you might try working with bin2hex or dechex and other such bin/hex functions PHP provides to check what the file type is in the header and what it reports itself to be in the extension. 

Additionally, you can always Google it.

Cheers,

Tedd

_______________
tedd sperling
tedd@xxxxxxxxxxxx









[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux