What is the output of following code?
<?php
$name = 'fpassthru.txt';
$str = <<<EOF
FOO
BAR
BAZ
EOF;
$fp = fopen($name, 'w');
fwrite($fp, $str);
fclose($fp);
$fp = fopen($name, 'r');
fgets($fp);
fpassthru($fp);
fclose($fp);
?>
a) FOO BAR
b) BAR BAZ
c) FOO BAZ
d) BAR FOO
<?php
$name = 'fpassthru.txt';
$str = <<<EOF
FOO
BAR
BAZ
EOF;
$fp = fopen($name, 'w');
fwrite($fp, $str);
fclose($fp);
$fp = fopen($name, 'r');
fgets($fp);
fpassthru($fp);
fclose($fp);
?>
a) FOO BAR
b) BAR BAZ
c) FOO BAZ
d) BAR FOO
No comments:
Post a Comment