return ($split[0] + ($split[1]/60) + ($split[2]/3600));
}
explode()
function returns a string array.
Therefore,
$split[0]
to
$split[n]
are strings, not numbers.
For string concat use
.
, not
+
.
For adding numbers, use
+
on numeric values, not on strings.
For casting strings into integers, you can use
intValue
function.
But don't forget about leading zeroes: string
'09'
becomes (int)9.
Also watch out for the number of decimals when dividing by 60 or by 3600.
In that function you mix up adding numbers and concatenating strings. First part is a string, 2nd and 3rd are numbers.
For me it is not clear what output you expect. You may post the expected input and output and we can help fixing the code.
Kind regards,
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
[code]...[/code]
blocks for better readability
AppGini 24.14 Revision 1665 + all AppGini Helper tools