working with arrays part two


You want to create an array, then traverse it.



Following up from part one – working with arrays.

To spin through all elements in our names array, here is the code below.




for ($i=0;$i<$count;$i++) { print($names[$i]."n"); }


Then for our string index array (hash):


while(list($k,$v)=each($addresses)) {
echo "$k lives at $vn";




[tags]PHP Arrays, PHP Hashes, PHP Coding School[/tags]


If you have found my website useful, please consider buying me a coffee below 😉

Leave a Reply

Your email address will not be published. Required fields are marked *