suredazzle
asked on
Date with Var_dump Returns String(36)
I am new to PHP.
Why var_dump returns string(36)?
I want to write date for var_dump. Can't figure what's the mistake.
Here is code:
<?php
$timeAdjust = strtotime("-8 hours");
var_dump(date("l, F d, Y @ g:i A", $timeAdjust)); //returns string(39) "Wednesday, February 06, 2008 @ 10:07 AM"
?>
Why var_dump returns string(36)?
I want to write date for var_dump. Can't figure what's the mistake.
Here is code:
<?php
$timeAdjust = strtotime("-8 hours");
var_dump(date("l, F d, Y @ g:i A", $timeAdjust)); //returns string(39) "Wednesday, February 06, 2008 @ 10:07 AM"
?>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi Hernst42,
Keep return as string, int with var_dump.
Gotta be a way, you write var_dump for date. :( Let me try more.
$today = date("l, F d, Y @ g:i A");
var_dump($today); //returns string(38) "Wednesday, February 06, 2008 @ 8:13 PM"
Keep return as string, int with var_dump.
Gotta be a way, you write var_dump for date. :( Let me try more.
$today = date("l, F d, Y @ g:i A");
var_dump($today); //returns string(38) "Wednesday, February 06, 2008 @ 8:13 PM"
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi Hernst42,
Thanks! Echo is best answer.
Try all possibilities. Please anyone knows var_dump, do give suggestion. Need to know what's the mistake.
========================== ========== ========== ========== ========== =====
$timeAdjust = strtotime("-8 hours");
echo date("l, F d, Y @ g:i A", $timeAdjust);
//var_dump($today); //return string(38) "Wednesday, February 06, 2008 @ 2:53 PM"
Thanks! Echo is best answer.
Try all possibilities. Please anyone knows var_dump, do give suggestion. Need to know what's the mistake.
==========================
$timeAdjust = strtotime("-8 hours");
echo date("l, F d, Y @ g:i A", $timeAdjust);
//var_dump($today); //return string(38) "Wednesday, February 06, 2008 @ 2:53 PM"
ASKER
I want exact date like this Wednesday, February 06, 2008 @ 10:07 AM.
It is a string, right?
I want var_dump. Let me try other date function not "strtotime".