shergold Posted July 6, 2009 Share Posted July 6, 2009 hey, i was just wondering how i would go about sorting information into arrays for example, if i got a list of all files in a directory, or information from a database? also is there away to echo out all the data in an array for example instead of typing out: echo $testarray[0]."< /br>"; echo $testarray[1]."< /br>"; echo $testarray[2]."< /br>"; echo $testarray[2]."< /br>"; Thanks, Shergold. Link to comment https://forums.phpfreaks.com/topic/164982-solved-sort-information-into-arrays/ Share on other sites More sharing options...
p2grace Posted July 6, 2009 Share Posted July 6, 2009 print_r($array) displays the values of an array. Otherwise you can use a foreach or for loop. As far as populating an array from a mysql query, check out mysql_fetch_assoc (http://us2.php.net/mysql_fetch_assoc) Link to comment https://forums.phpfreaks.com/topic/164982-solved-sort-information-into-arrays/#findComment-869958 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.