Home Tutorial Php Phpfiles PHP fpassthru() function and example

 
 

Share on Google+Share on Google+
PHP fpassthru() function and example
Posted on: October 29, 2009 at 12:00 AM
Advertisement
In this section of PHP tutorial we will see the use of fpassthru() function and its related example

Syntax
int fpassthru ( file_handle)

  • It reads the rest of the file contents from the current pointer. to the EOF.
  • It returns the no of character to the output console
  • If some function  has read the  file then it will not  read all, it will read only the rest.
  • To read the whole file use the rewind() function


Example of PHP fpassthru() Function

Code for PHP fpassthru() Function
<?php
    $file=fopen("c:/rose1/ram.txt","r");
    for($x=0;$x<=21;$x++)
      fgetc($file);
    $data1=fpassthru($file);
    echo $data1;
?>

Output
second line third line fourth line

Advertisement

Related Tags for PHP fpassthru() function and example:


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.

Posted on: October 29, 2009

Recommend the tutorial

Advertisements Advertisements
 

 

 

DMCA.com