<?php require_once 'File.php'; $file = "/home/tal/example.txt"; //Echo the whole file echo File::readAll($file); //Now use a different approach $fp = new File(); //Write a single line to the file, using a Macintosh EOL character and //truncating the file before writing to it $fp->writeLine($file, "This is a single line", FILE_MODE_WRITE, "\r"); //strip leading and trailing separators from the file path echo $fp->stripLeadingSeparators($file); echo $fp->stripTrailingSeparators($file); ?>
Deliver First Class Web Sites: 101 Essential Checklists Want to learn how to make your web sites usable and accessible? Want to ensure that your sites meet current best practice, without spending hours trawling through incomprehensible specifications and recommendations from dozens of different books, research papers, and web sites? Want to make sure that the sites you build are "right the first time," requiring no costly redevelopments?