project3 Posted November 13, 2008 Share Posted November 13, 2008 How would I go about writing a function to create return an array of dates given an array of timestamps and set the keys to be the timestamps function get_dates($array){ } Link to comment https://forums.phpfreaks.com/topic/132599-solved-php-date-function/ Share on other sites More sharing options...
.josh Posted November 13, 2008 Share Posted November 13, 2008 foreach ($array as $timestamp) { $somedate = date("some date format here", $timestamp); $newarray[] = $timestamp => $somedate; } Link to comment https://forums.phpfreaks.com/topic/132599-solved-php-date-function/#findComment-689489 Share on other sites More sharing options...
project3 Posted November 13, 2008 Author Share Posted November 13, 2008 foreach ($array as $timestamp) { $somedate = date("some date format here", $timestamp); $newarray[] = $timestamp => $somedate; } Thanks!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Link to comment https://forums.phpfreaks.com/topic/132599-solved-php-date-function/#findComment-689492 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.