Login   Register  
PHP Classes
elePHPant
Icontem

File: demo/helloworld3.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Thomas Björk  >  OBPipe  >  demo/helloworld3.php  >  Download  
File: demo/helloworld3.php
Role: Example script
Content type: text/plain
Description: A simple Hello, world! demo
Class: OBPipe
Manipulate PHP output with named pipe buffers
Author: By
Last change:
Date: 2011-03-14 16:32
Size: 607 bytes
 

Contents

Class file image Download
<?php
include('../obpipe.php');

// Create a dynamic output handler
$pipe = new OBPipe();

// Activate the pipe called bravo
$pipe->activate('bravo');

// Output some text
echo ", world!";

// Activate the pipe named alpha
$pipe->activate('alpha');

// Output some text
echo "Hello";

// Reorder the output
$pipe->setNames(array('alpha''bravo'));

// Collect the output in a variable
$data $pipe->Output('');

// Kill the output handler
$pipe->kill();

// Remove the handler
$pipe null;

// Output the data in a reverse order
echo strrev($data);
/*
 * The expected output is:
 * "!dlrow ,olleH"
 */
?>