You are here: Re: What function? « PHP Programming Language « IT news, forums, messages
Re: What function?

Posted by Captain Paralytic on 10/19/07 11:22

On 19 Oct, 12:07, "salonowiec" <debrza_removet...@poczta.onet.pl>
wrote:
> My very basic code is:
> <?php
> $fname='alpha.ext';
> readfile($fname);
> ?>
> Only when ext is txt I'm getting a reasonable content, otherwise there's a
> lot of bush. What function should I use to open doc, xls, pdf, gif?...
> Can you help to a supernewbie???

This has nothing to do with the extension. It is the contents of the
files.

If you renamed alpha.ext to alpha.doc, the output would still be the
same.

In general, a .doc file will be written by Microsoft Word in its
custom format, similarly for all the other files.

A .gif file is a binary representation of an image. If you send the
correct headers, then the results of the readfile with a .gif file
would be an image on your browser.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация