Share on Google+Share on Google+

PHP readfile() Fucntion and example

In this part of the tutorial we will learn about the function readfile() in context of file handling. And we will also see the example related to the readfile() function

Syntax for PHP readfile() Function
int readfile(file_name[,path_include[,context]])

  • readfile() function] is used to read the file.
  • Then it displays the file contents to the browser using buffer.
  • It returns the no of bytes read.
  • On error it returns the FALSE and display the error message.
  • But if @readfile() function is used then error message will not come.

Example of PHP readfile() Function
Source Code for PHP readfile() Function


This site contains many quality Java, JSP Tutorials, Hibernate Tutorials, Struts Tutorials, JSF Tutorials, RMI, MySQL Tutorials, Spring Tutorials, source codes and links to other java resources.


Posted on: October 30, 2009 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Share this Tutorial Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.


Advertisement null