PHP Classes

File: example1.php

Recommend this page to a friend!
  Classes of Rick Hodger   filesnap   example1.php   Download  
File: example1.php
Role: Example script
Content type: text/plain
Description: Example 1
Class: filesnap
Stream wrapper to write and read snapshot files
Author: By
Last change:
Date: 17 years ago
Size: 380 bytes
 

Contents

Class file image Download
<?php

/**
 * In this example we use the filesnap stream wrapper to write to a file.
 * Each time this script is called, the wrapper will make a new snapshot of 'test.txt',
 * and then write an additional line onto the end of the script.
 */

require("filesnap.class.php");

if (
$fp=fopen('snapshot://test.txt','a')) {
   
fwrite($fp,"Wrote one line of text\n");
   
fclose($fp);
}

?>