Midnite Posted January 25, 2010 Share Posted January 25, 2010 I am working on a page in my personal website and I am having a few problems with a few things ... could somone please help with a few snippets of code that can do the following I have a folder called generic ... and in that folder are files called 12am,1am,2am ETC ETC till 11am then they go 12pm,1pm,2pm etc etc till 11pm what I would like to do is set a variable say $hour to for example be $hour."am or pm depending on the $hour variable selected .txt" so that I can tell my php script to copy the files in that order from generic folder to the live folder .... Also I am having some issues with a meta refresh timer based off of PHP could someone help solve this with me I can get the time the song starts say 12:15am but then I need to have a php script read that and then the current time and subtract the 2 to get how long it has been playing then subtract that from the song length and make that the meta refresh time for the page ... Link to comment https://forums.phpfreaks.com/topic/189780-please-help-if-you-can/ Share on other sites More sharing options...
pernest Posted January 26, 2010 Share Posted January 26, 2010 Have a look at http://uk.php.net/manual/en/function.date.php and http://uk.php.net/manual/en/function.time.php, but to get what you want try this: $what_you_want = DATE("ga", time()).".txt"; For your second problem, I'm not totally sure what you are asking, but I think what you want can be easily done using strtotime() if you can pull the whole date as well as the time. Link to comment https://forums.phpfreaks.com/topic/189780-please-help-if-you-can/#findComment-1001616 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.