How can I loop through the members of an array?
<?php
$alphabet = range("A","Z");
foreach($alphabet as $letter) { echo "Ooh look! The letter $letter\n"; }
?>
Prints this:
Ooh look! The letter A
Ooh look! The letter B
Ooh look! The letter C
Ooh look! The letter D
Ooh look! The letter E
Ooh look! The letter F
Ooh look! The letter G
Ooh look! The letter H
Ooh look! The letter I
Ooh look! The letter J
Ooh look! The letter K
Ooh look! The letter L
Ooh look! The letter M
Ooh look! The letter N
Ooh look! The letter O
Ooh look! The letter P
Ooh look! The letter Q
Ooh look! The letter R
Ooh look! The letter S
Ooh look! The letter T
Ooh look! The letter U
Ooh look! The letter V
Ooh look! The letter W
Ooh look! The letter X
Ooh look! The letter Y
Ooh look! The letter Z
Comment on this Question and Answer >>>
ASK A QUESTION
More arrays PHP Questions
when i fetch the record in the database but they skip first record in the databaseHow do we sort an array of names taken from a text file, displaying only unique names?
How can I create an array of numbers easily?
I have an array of a hundred or so lines, each line has data with "|" separated values. I need to scan through this array, and select the line whose first 5 characters matches a text string. Any ideas or questions?
How can I sort a multi-dimensional array?
