I want to echo out each date in my Array within a PHP file. Right now my code is
foreach ($result_array as $date) {
echo $date;
}
which results in
ArrayArrayArrayArrayArrayArray
How can I modify my code to show each date rather then Array?
EDIT
I’m building the array like so…
$result_array = array();
$result_set = mysql_query("SELECT DISTINCT `saledate` FROM `phoneappdetail` WHERE salebarn = 'OSI'");
while ( $row = mysql_fetch_array($result_set) ) {
$result_array[] = $row;
}
It prints Array because
$dateis array, modify your script like this:Read more on how mysql_fetch_array works, it returns array (indexed, associative or both), so you need to choose which field you want to use.
Note from manual: