Use the optional flags parameter since PHP 5 for file function in PHP

Description

The following code shows how to use the optional flags parameter since PHP 5 for file function.

Example


/* w  ww .  jav  a 2  s  .  c o  m*/
<?php
$trimmed = file('test.txt', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
echo $trimmed;
?>

The code above generates the following result.





















Home »
  PHP Tutorial »
    File »




Directory
DirectoryIterator
Drive
File
File Permission
File Read Save
FileSystemIterator
Path
Zip