- print_r: documentation ( source)
<?php
/*
* Examples of DoublyLinkedList
*/
$obj = new SplDoublyLinkedList();
// Check wither linked list is empty
if ($obj->isEmpty())
{
echo "Adding nodes to Linked List<br>\r\n";
$obj->push(2);
$obj->push(3);
echo "Adding the node at beginning of doubly linked list <br>\r\n";
$obj->unshift(10);
}
echo "<br>Our Linked List:";
print_r($obj);
echo "<br>Pick the node from beginning of doubly linked list \r\n";
echo $obj->bottom();