How to take a value within the array

Asked

Viewed 33 times

0

I would like to know how to get the value of this array

Array ( [TIMEDIFF('2017-12-14 17:44:14', '2017-12-14 16:12:21')] => 01:31:53 )

I’ve tried to

$timEnd  = $resultConvertido['TIMEDIFF('2017-12-14 17:44:14', '2017-12-14 16:12:21')'];

but this returns:

Notice: Undefined index: [TIMEDIFF('2017-12-14 17:44:14', '2017-12-14 16:12:21')] in C:\xampp\htdocs\admin\getTime.php on line 45
  • Of the one var_dump in $resultConvertido and puts the result in the answer

  • array(1) { ["TIMEDIFF('2017-12-14 17:53:56', '2017-12-14 16:12:21')"]=> string(8) "01:41:35" }

  • Have you tried reset($resultConvertido); ?

  • It worked, thank you.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.