Hello guys! I need some help from you... I have created an array with many elements like $arrayName = array("a","b","c","d",); what i want is to add a timestamp to each of its elements which is shown like this: Created on: August 27, 2007 or Created on: August 27, 2007 at 7:23pm these timestamps should only show the time when they were created and not the timestamp of all array elements should be same. Can i do it? if, then how?
Umm... The elements are created as soon as this code is being parsed: $arrayName = array("a","b","c","d",); PHP: Which would take less than a second, and therefore all timestamps would be the same. Can you be more specific? Do these values from from a database?
Maybe something like this: $my_array = array(); $my_array[] = array('timestamp' => time(), 'value' => 'a'); PHP: Then when you want to show the time, use date() function to format the timestamp. http://www.php.net/date http://www.google.com/search?source...2007-03,GFRD:en&q=php+multidimensional+arrays
sorry hamidof, i couldn't get what u want to explain. I'm new in php nico_swd, yes sure.. i have no experience in database, i can open my phpmyadmin and you guide me what to do with database to add timestamps to my array elements. thanks