Stream_Var
[ class tree: Stream_Var ] [ index: Stream_Var ] [ all elements ]

Source for file example_file.php

Documentation is available at example_file.php

  1. <?PHP
  2.     require_once 'Stream/Var.php';
  3.     stream_wrapper_register"var""Stream_Var" );
  4.     
  5.     $myVar = array(
  6.                     "foo" => "bar",
  7.                     "argh" => "I really like tomatoes."
  8.                    );
  9.     
  10.     echo    "myVar:";
  11.     echo    "<pre>";
  12.     print_r$myVar );
  13.     echo    "</pre>";
  14.  
  15.     echo    "<strong>open 'var://GLOBALS/myVar/argh'</strong><br>";
  16.     if ($fp fopen('var://GLOBALS/myVar/argh','r+')) {
  17.         echo    "success!<br>";
  18.  
  19.         $data fread($fp9);
  20.         echo    "reading 9 chars from stream: $data<br>";
  21.     
  22.         echo "write 'hate' to stream.<br>";
  23.         fwrite($fp,"hate");
  24.         
  25.         fclose($fp);
  26.     }
  27.     echo    "<br>";
  28.     echo    "myVar after fwrite:";
  29.     echo    "<pre>";
  30.     print_r$myVar );
  31.     echo    "</pre>";
  32. ?>

Documentation generated on Mon, 11 Mar 2019 15:32:46 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.