It returns line from file pointer and strip HTML tags
Example
<?php
$fp = @fopen(“test.txt”, “r”);
if ($fp) {
while (($content = fgetss($fp, 4096)) !== false) {
echo $content;
}
fclose($fp);
}
?>
It returns line from file pointer and strip HTML tags
Example
<?php
$fp = @fopen(“test.txt”, “r”);
if ($fp) {
while (($content = fgetss($fp, 4096)) !== false) {
echo $content;
}
fclose($fp);
}
?>
It returns line from file pointer
Example
<?php
$fp = @fopen(“test.txt”, “r”);
if ($fp) {
while (($content = fgets($fp, 4096)) !== false) {
echo $content;
}
fclose($fp);
}
?>
It returns line from file pointer and parse for CSV fields
Example
<?php
$filename = “test.csv”;
echo “<table border=’1′>”;
if (($handle = fopen($filename, “r”)) !== FALSE) {
while (($data = fgetcsv($handle, 1000, “,”)) !== FALSE){ ?>
<tr><?php foreach($data as $values) {?><td > <?php echo $values ?></td><?php } ?></tr>
<?php }
}
echo “</table>”;
?>
It returns character from file pointer
Example
<?php
$fp = fopen(‘test.txt’, ‘r’);
while (!feof($fp)) {
echo fgetc($fp);
}
fclose($fp);
?>
It flushes the output to a file
Example
<?php
$filename = ‘test.txt’;
$file = fopen($filename, ‘r+’);
fwrite($file, ‘phpcodez’);
fflush($file);
?>
It checks for end-of-file on a file pointer
Example
<?php
$fp = fopen(‘test.txt’, ‘r’);
while (!feof($fp)) {
}
fclose($fp);
?>
It closes an open file pointer
Example
<?php
$fp = fopen(‘test.txt’, ‘r’);
fclose($fp);
?>
Its an alias of disk_free_space() and returns available space on filesystem or disk partition
Example
<?php
echo diskfreespace(“/”);
?>
Output
200833871872
It returns the total size of a filesystem or disk partition
Example
<?php
echo disk_total_space(“/”);
?>
Output
239940263936
It returns available space on filesystem or disk partition
Example
<?php
echo disk_free_space(“/”);
?>
Output
200834342912