Page 1 of 1

array has values posted to each of its elements

Posted: Wed Jul 16, 2008 7:32 am
by geethalakshmi
Hi,

How do I find out if an array has values posted to each of its elements? I need to know that EVERY element has been filled out.

Regards,
geetha
Scripts Directory

Re: array has values posted to each of its elements

Posted: Wed Jul 16, 2008 8:10 am
by Dynamis
The following code will print all of the elements in an array until an element does not exist

Code: Select all

for($x=0;$array[$x];$x++){
  echo $x.": ".$array[$x]."<br>";
}
Hope that is what you are looking for.