If you have an array that already exist how would you add to it?
$arrayPeople = array("John", "Susie", "Dave"); //lets add one to it $arrayPeople = array("Sam");
When returned I only get Sam.
Any help is appreciated.
G
<?php $arrayPeople = array("John", "Susie", "Dave"); print_r ($arrayPeople); echo "<BR>"; $counter = count($arrayPeople); $arrayPeople[$counter] = "Sam"; print_r ($arrayPeople); ?>
reg kevin
You can use array_push()
http://www.php.net/manual/en/function.array-push.php
$arrayPeople = array("John", "Susie", "Dave"); //lets add one to it array_push($arrayPeople,"Sam");