- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
fpassthru() function in PHP
The fpassthru() function reads from an open file, until EOF, and writes the result to the output buffer. It returns the number of characters read from the file pointer, otherwise if an error occurs, it returns FALSE.
Syntax
fpassthru(file_pointer):
Parameters
file_pointer − The file pointer must point to a file successfully opened by fopen() or fsockopen() (and not yet closed by fclose()).
Return
The fpassthru() function returns the number of characters read from the file pointer, otherwise if an error occurs, it returns FALSE.
Example
<?php $file_pointer = fopen("new.txt","r"); fgets($file); echo fpassthru($file_pointer); fclose($file_pointer); ?>
The following is the output. The characters are 22.
Output
Demo text!! This is it!22
Advertisements
To Continue Learning Please Login
Login with Google