When i do this why do i get the file content + 1 retuned : echo include("content/news.txt")? Fix?
Nov 28th, 2008 00:16
healthy man, dman, Alina jane, Articles Hosting, Matthew Walker, Martyn PIttuck,
This is happening because you are misunderstanding how include() works.
You do not need to echo it. How include works is as follows:
You call include("content/news.txt");
PHP makes sure the file exists.
If it does, it turns off PHP parsing mode, and starts reading the file.
Unless it encounters a new PHP script tag, it will just pass the
contents of the file on to the webserver to send to the browser.
The '1' you are getting is the return code of include(), saying that it
succeeded in including the file.
i hope that helps: