PHP Classes

File: dListExample.php

Recommend this page to a friend!
  Classes of Martin L   dList v3   dListExample.php   Download  
File: dListExample.php
Role: Example script
Content type: text/plain
Description: the example file
Class: dList v3
ArrayList like .net with DB Serialization!
Author: By
Last change: The example for dlist v2
Date: 20 years ago
Size: 1,581 bytes


Class file image Download
//this example only works with strings but dlist also supports objects in the same way

//Create an object of dList
$myList=new dList();
//Set the parameters for db Features
//Parameters: Server,User,DbPassword,Database,Table name, Autocreate Table

//Manually set the identification string to look for data of recent sessions

//echo "<br>->".$myList->GetIdentity()."<-<br>";

//Load the data of recent sessions
$myList->SwitchToDbMode(); //Switch to direct Database mode

//Try some from the commented commands to see how powerful this list is


//Add some additional data
$myList->Add(" 1 ");
$myList->Add(" 2 ");
$myList->Add(" 3 ");
$myList->Add(" 4 ");
$myList->Add(" 5 ");

$myList->Add(" 6 ");
$myList->Add(" 7 ");
$myList->Add(" 8 ");
$myList->Add(" 9 ");

//if($myList->Contains(" 4 "))echo "jo";
//echo $myList->Get(3);

//$myList->Remove(" 3 ");
echo "<br>";
//echo $myList->IndexOf(" 2 ");
//echo $myList->LastIndexOf(" 2 ");
echo "<br>";
echo "<br>";