1
After getting the time difference between two fields input time
(vine this question), I don’t know now how to put these values within variables, so I can use them in other functions.
The var_dump
of the variable $intervalo
(who guards the dateInterval
) is:
Object(Dateinterval)#3 (15) { ["y"]=> int(0) ["m"]=> int(0) ["d"]=> int(0) ["h"]=> int(5) ["i"]=> int(18) ["s"]=> int(0) ["weekday"]=> int(0) ["weekday_behavior"]=> int(0) ["first_last_day_of"]=> int(0) ["invert"]=> int(0) ["days"]=> int(0) ["special_type"]=> int(0) ["special_amount"]=> int(0) ["have_dayweek_relative"]=> int(0) ["have_special_relative"]=> int(0) }
(in bold above are the fields that matter)
So I tried something like:
$hora = $intervalo[h];
or
$hora = $intervalo["h"];
or
$hora = $intervalo['h'];
But I think [h] is not a vector... The question is: how to put the property [h] in a variable?
I searched the manual page, but my English is not there these things, so did not solve.
Perfect, thank you very much!
– gustavox