Jump to content

How do you move the file pointer?


fishfin

Recommended Posts

something like this, you can try it idk if it works just typed it

 

<?php
function readLine( $desiredLine, $handle, $length=1024 )
{
if ( !$handle )
echo 'not a valid handle.';

$ctr = 0;

while ( $ctr!=$desiredLine )
{
$line = fgets( $handle, $length );
if ( feof($handle) )
{
$line = 'error: invalid line number';
break;
}
$ctr++;
}

echo $line;
}
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.