PHP Classes

File: README

Recommend this page to a friend!
  Classes of Biswarup Adhikari   PHP Linked List   README   Download  
File: README
Role: Documentation
Content type: text/markdown
Description: PHPLinkedList Documentation
Class: PHP Linked List
Manage elements stored in a linked list
Author: By
Last change:
Date: 8 years ago
Size: 806 bytes
 

Contents

Class file image Download

Include PHPLinkedList Class

<?php 
require_once 'PHPLinkedList.php';

Initialize new LinkedList

$myLinkedList=new PHPLinkedList;

Add New Item To LinkedList

$myLinkedList->put(1);
$myLinkedList->put("Biswarup");

Append Item

$myLinkedList->append("biswarupadhikari@gmail.com");

Prepend Item

$myLinkedList->prepend("www.biswarupadhikari.com");

Get First Item From LinkedList

var_dump($myLinkedList->first());

Get Last Item From Linked List

var_dump($myLinkedList->last());

Get Item From LinkedList By Position

var_dump($myLinkedList->get(0));
var_dump($myLinkedList->get(2));
``

# Count Total Number Of Items

var_dump($myLinkedList->count());


# How to run test cases

$ php test.php