Does anyone know of a way I could input a date into say a function and that function result in the actual day..
Like say I put this (fake function)
$TheDay = fake_date_function('09-05-08'); echo("Today is ".$TheDay.".");
RESULT:
Today is Friday.
thanks, `eff
<?php echo date("l",strtotime($fake_date)); ?>
That totally almost works..
I've changed it alil to this
$TheDay='09-04-2008'; $Datez = date("l",strtotime($TheDay)); echo($Datez);
but there is one problem... Sept 4th lies on a Thurdsay not a wednesday
see if switching the '-' to '/' makes a difference
NVRM user error..
it only works if the date is placed in a specific order..
DD-MM-YYYY
I'm used to MM-DD-YYYY
Thanks a million man.. really saved me a TON of extra work.
I actually still need to do alil filtering and switching tho.. because The date comes to me as
(today):
Sep-5-2008 So i'll have to run a switch on the month to turn Sep into 09
no problem 🙂 glad i could have helped... make sure to mark the thread resolved
lol I ended up just making my own lil function for this.. so I could have less to type out...
here it is if anyone might be interested.. (Not really that complicated)
TheDay() Function:
function TheDay($x) { $TD_Date=$x; $TD_Get=date('l',strtotime($TD_Date)); return($TD_Get); }
Syntax:
TheDay('DD-MM-YYYY');
efficacious wrote:here it is if anyone might be interested.. (Not really that complicated)
It could be simplified 🙂
function TheDay($x) { return date('l', strtotime($x)); }