Link to home
Start Free TrialLog in
Avatar of suredazzle
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"

?>
ASKER CERTIFIED SOLUTION
Avatar of hernst42
hernst42
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of suredazzle
suredazzle

ASKER

Hi Hernst42,

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".
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"

SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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"