Home >> PHP >> readfile() function in PHP

readfile() function in PHP

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

This function returns the number of bytes read on success, or false and an error on failure.

Syntax

readfile(filename,include_path,context)

Example

$filename = 'content.txt';

if (!readfile($filename)) {
       echo 'Could not open file';
}

Post Your Comment

Next Questions
readlink() function
realpath() function
rename() function
tmpfile() function
umask() function
How to swap two numbers without using a temprory variable
How to swap two numbers
How can find factorial using for loop
How can find reverse number of a number
How can find number is palindrome or not
How can check number prime number or not
Fibonacci series
Fibonacci series using recursive
Print number 1 to 10 without loop
How can i sort array ascending order without function
How can i sort array descending order without function
How can find max difference between two elements from an array
How can find min difference between two elements from an array
How can find average from an array
How can find max element from an array
How can find min element from an array
How to connect mysql database with php
Remember password
How can find reverse string without function
How can find reverse word of string without function

Copyright ©2022 coderraj.com. All Rights Reserved.