PHP Classes
Icontem

File: example.php4


  Search   All class groups All class groups   Latest entries Latest entries   Top 10 charts Top 10 charts   Newsletter Newsletter   Blog Blog   Forums Forums   Help FAQ Help FAQ  
  Login   Register  
Recommend this page to a friend! ReTweet ReTweet Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Michal Golebiowski  >  FIFO Queue  >  example.php4  
File: example.php4
Role: Example script
Content type: text/plain
Description: An example of using queue class for PHP 4
Class: FIFO Queue
Implementation of FIFO (First In First Out) queue
 

Contents

Class file image Download
<?php
/**
* Example of using queue for PHP 4
*/

// Include queue class
require_once( 'queue.class.php4' );

// Test item queue class
class ItemTest
{
  var 
$id 0;
  
  function 
__construct$id )
  {
    
$this->id $id;
  }
}

$objQueue = new Queue;

// Adding some items to queue
for ( $i 1$i <= 15$i ++ )
{
  
$objQueue->Put( new ItemTest$i ) );
}

// Geting items from queue and printing them
while ( $result $objQueue->Get() )
{
  print 
$result->id."<br>";
}
?>

 
  Advertise on this site Advertise on this site   Site map Site map   Statistics Statistics   Site tips Site tips   Privacy policy Privacy policy   Contact Contact  

For more information send a message to :
info at phpclasses dot org.
Copyright (c) Icontem 1999-2009 PHP Classes - PHP Class Scripts
  PHP Book Reviews - Reviews of books and other products