PHP code example of vbpupil / queue

1. Go to this page and download the library: Download vbpupil/queue library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

vbpupil / queue example snippets




use vbpupil\Queue\Queue;

// create a new queue and specify a limit - here we have set it to hold 1 item.
$q = new Queue(1);

//add items
$q->addItem('Item 1')
    ->addItem('Item 2')
    ->addItem('Item 3')
    ->addItem('Item 4')
    ->addItem('Item 5');

echo($q->getItems());