I am creating a PHP script to generate a json
from a webvtt
caption file, I get the start and end that are in the minuto:segundo.milisegundo
format or if the video is too large they come as hora:minuto:segundo.milisegundo
for future comparisons in JS in the future where the video is being played I need to compare these values with the currentTime
of the video which in turn delivers the time in seconds segundos.milisegundos
and to facilitate such comparison I would like my PHP already deliver the start and end time of each caption already in the same format as currentTime
of the video, how can I do it?
Here's an example:
$start = "00:05.570";
$fim = "00:09.700";
In the above example it would be easy to distinguish that currentTime
would be 5.570
and 9.700
how do I convert PHP to that format?