Hi; Here's the deal. I have sets of dated observations in my database. I will have a variable count of observations per person over time. (ie. starting observation date, and then one or more subsequent observations).
When I do my mysql query to get data, I deposit all the dates (in unix_timestamp form) in an array (called, say; $mydates). I want to sort($mydates) and then use $mydates[0] as $start_date=$mydates[0];
print_r($mydates) looks like this: "Array ( [0] => 1347858000 [1] => 1371013200 )"
so far so good.... and in this case $mydates[0] shows up in calculations as 1347858000 like it should
BUT I then want to arsort($mydates) (ie. $myRdates=arsort($mydates)) so that I can use $end_date=$myRdates[0] as the final date for the series (ie to calculate number of days over which observations took place).
print_r($myRdates) looks like this: "1"
I don't get what's going on here...