array has values posted to each of its elements

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
geethalakshmi
Forum Commoner
Posts: 31
Joined: Thu Apr 24, 2008 10:38 pm

array has values posted to each of its elements

Post 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
Dynamis
Forum Contributor
Posts: 122
Joined: Thu Jul 10, 2008 3:15 pm
Location: Indiana, US

Re: array has values posted to each of its elements

Post 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.
Post Reply