I'm looking for a best and easiest way to get (parse?) downwards counter numbers (time) from remote server to another. Time in downwards counter can be between 60min - 0min and it can jump (for example) from 2min 30sec back to 60min and it counts again towards zero. So I need to get updated counter time from remote server to another. Time have to be update atleast every 30sec or rather constantly. What would be best solution to do this?
Doing it with PHP could be wastage of lots of resources when it can be done with javascript. Use PHP just to get the starting time of the counter.
$data = "33 minutes 42 seconds"; if (strpos($data,'minutes')) { preg_match('/([0-9]+) minutes ([0-9]+) seconds/',$data,$match); $seconds = ($match[1] * 60) + $match[2]; } else { preg_match('/([0-9]+) seconds/',$data,$match); $seconds = $match[1]; } PHP: