This topic is: resolved
- This topic has 4 replies, 2 voices, and was last updated 8 years, 9 months ago by .
Viewing 5 posts - 1 through 5 (of 5 total)
Viewing 5 posts - 1 through 5 (of 5 total)
- You must be logged in to reply to this topic.
Home › Forums › Quform WordPress › Time array problem
Hello, I have a time field in h:i A format. I am trying to access it via session variable, but for some reason I can’t. Here is my code. Can you see the problem?
$upTime=$_SESSION[‘iphorm_2’][‘iphorm_2_18’]; //Timestamp
$upTime = isset($upTime[‘hour’], $upTime[‘minute’], $upTime[‘ampm’]) ? date(‘h:i A’, strtotime(“{$upTime[‘hour’]}:{$upTime[‘minute’]}:{$upTime[‘ampm’]}”)) : ”;
I can see the array object via var_dump:
[“iphorm_2_18”]=> array(3) { [“hour”]=> string(2) “10” [“minute”]=> string(2) “36” [“ampm”]=> string(2) “pm” }
Hello, hoping this is a simple fix. I can do the same with isset for date, but for some reason doing the same procedure for time results in the value of my variable being 12:00 am no matter what time is actually in $_SESSION[‘iphorm_2’][‘iphorm_2_18’]
Any ideas?
You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
I will try it out. Thank you!
Resolved! Thank you Ally! Figured it was something easy…