Yes and no...You are talking about a linked list correct? Like
head -> [1] -> [4] -> [3] -> //
PhP has no pointers. So you have to do a bit of a trick. If you have ever worked with JAVA its more like a "linked list" in java. What you have is one object which points to another object... I couldnt find any code so I just hacked some out real quick... Sorry its long.
<?php
class node {
var $next;
var $data;
function node() {
$this->data = "";
$this->next = "";
}// end node
function setData($var) {
$this->data = $var;
}
function getData() {
return $this->data;
}
function getNext() {
return $this->next;
}
function setNext($var) {
$this->next = $var;
}
}// end node
// Linked list
$head = new node();
$head->setData(0);
$head = $tmphead;
// Insertion
for($i = 1;$i < 10;$i++) {
$oldhead = $head;
$head = new node();
$head->setData($i);
$head->setNext($oldhead);
}// end for
// Display
$j = 0;
while($head != "") {
echo $head->getData() . "<br>";
$head = $head->getNext();
}
?>
That should be a linked list... From that you could create BST's AVL Trees, Stacks, Queues...etc...
Hope that helps!