To display the elements you need to change it slightly.
PHP Code:
for($x = 0; $x < count($array); $x++) { echo $array[$x]; }
That'll display all elements, regardless of size.
If you want to add and delete elements to the array,youll have to store the array in a session to stop it being lost everytime the page is loaded.
So after the original code you posted which checks what should be carried out (add,delete,search) save the array into a session
PHP Code:
$_SESSION['myarray'] = $array;
Then at the start of the page
PHP Code:
if(isset($_SESSION['myarray'])) $array = $_SESSION['myarray']; else $array = array(); // first time user has loaded page
__________________
Digital Fields - Web Design
Please login or register to view this content. Registration is FREE
|