How to use Filesystem readfile in PHP

In this article I am going to explain about readfile function in PHP.
  • 1496

PHP readfile() Function

The filesystem readfile function reads a file and writes it to the output buffer.

Syntax of readfile function

readfile(FileName, includePath, context)

Parameters in readfile function

It have three parameter:

Parameter Description
FileName Specifies the file to read.
includePath Set it true, if you will want to search for the file in the includePath.
context Specifies the context of the file handle.

Example of filesystem readfile function

<html>

<body>

<?php

echo readfile("C:\wamp\www\Dinesh\PhpIntro.txt");

?>

</body>

</html>

 

Output:

readfile-php-function.jpg

You may also want to read these related articles :
here

Ask Your Question 

Got a programming related question? You may want to post your question here

Programming Answers here

Categories

More Articles

© 2020 DotNetHeaven. All rights reserved.