<?php
int fpassthru ( res $stream )
where,
$stream = The valid file pointer opened by fopen
or fsockopen and not yet closed by fclose
?>
<?php
define('PAW', 'file://' . __DIR__ . '/adds/');
echo PAW . '<br><br>';
$fl01 = PAW . 'love.txt';
$opts01 = [ 'https' => [ 'method'=>"POST",
'header' => "Accept-language: en",
'content' => $fl01 ] ];
$cntxt01 = stream_context_create($opts01);
var_dump($cntxt01);
echo '<br><br>';
$f01 = fopen($fl01, "r", false, $cntxt01);
rewind($f01);
// RESETS THE FILE POINTER TO THE BEGINNING
$int = fpassthru($f01);
// READS TO THE EOF
echo '<br><br>' . $int . ' characters read.';
fclose($f01);
?>
<?php
define('PAN', __DIR__ . '/adds');
echo PAN . '<br><br>';
$fl02 = PAN . '/star.png';
$f02 = fopen($fl02, "r");
rewind($f02);
// RESETS THE FILE POINTER TO THE BEGINNING
$int = fpassthru($f02);
// READS TO THE EOF
echo '<br><br>' . $int . ' characters read.';
fclose($f02);
?>