Arrays in PHP fall into two categories-- indexed and associative. An indexed array is where each array element is denoted by a number (a subscript). They are a bit like arrays in C.
Ex:
[tt]<?php
$thisarray[0] = "Howdy!"
$thisarray[1] = "This"
$thisarray[2] = "Is"
$thisarray[3] = "A"
$thisarray[4] = "Test."
$thisarray[5] = "STOP!!!"
for ($i=0; $thisarray[$i] != "STOP!!!"; $i++) {
echo '<td>' . $thisarray[$i] . '</td>';
}
?>
[/tt]
The other kind of array is an associative array. In these, each element is denoted by another string value. A bit like a hash in Perl. Example: (take note of the beginning of the script)
[tt]<?php
$dictionary['mouth'] = 'the opening through which an animal takes in food';
$dictionary['free'] = 'enjoying personal rights or liberty';
$dictionary['rush'] = 'to move, act, or progress with speed';
?>
<html><head><title>Dictionary</title></head>
<body>
<h1>A Little Dictionary</h1>
<h3>Look up a word:</h3>
<form method="GET" action="dictionary.php">
<input type=text name="word">
<input type=submit>
</form>
<?php
if (isset($_GET('word')) {
if (isset($dictionary($_GET('word')) {
?>
<HR>
<H2><?php echo $_GET('word') ?></H2>
<P><?php echo $dictionary($_GET('word')) ?></P>
<?php
} else {
?>
<HR>
<P>Error: The word '<?php echo $_GET('word')?>' is not in our dictionary.</P>
<?php
} else {
?>
<P>Please type a word into the box, and click Submit.</P>
<?php
} ?>
<HR>
<SMALL><I>Powered by Tek-Tips Forums</I></SMALL>
</body>
</html>[/tt]
I REALLY hope that helps.
Will