[], 'units' => 'raw', // 'pace' => false ]; $pFFA = new adriangibbons\phpFITFileAnalysis(__DIR__ . $file, $options); } catch (Exception $e) { echo 'caught exception: '.$e->getMessage(); die(); } $units = 'm'; $pool_length = $pFFA->data_mesgs['session']['pool_length']; $total_distance = number_format($pFFA->data_mesgs['record']['distance']); if ($pFFA->enumData('display_measure', $pFFA->data_mesgs['session']['pool_length_unit']) == 'statute') { $pool_length = round($pFFA->data_mesgs['session']['pool_length'] * 1.0936133); $total_distance = number_format($pFFA->data_mesgs['record']['distance'] * 1.0936133); $units = 'yd'; } ?>
This is a demonstration of the phpFITFileAnalysis class available on GitHub
Length | Time (min:sec) | # Strokes | Stroke | data_mesgs['length']['total_timer_time']); $active_length = 0; for ($i=0; $i<$lengths; $i++) { $min = floor($pFFA->data_mesgs['length']['total_timer_time'][$i] / 60); $sec = number_format($pFFA->data_mesgs['length']['total_timer_time'][$i] - ($min*60), 1); $dur = $min.':'.$sec; if ($pFFA->enumData('length_type', $pFFA->data_mesgs['length']['length_type'][$i]) == 'active') { echo '|
---|---|---|---|---|
'.($i+1).' | '; echo ''.$dur.' | '; echo ''.$pFFA->data_mesgs['length']['total_strokes'][$i].' | '; echo ''.$pFFA->enumData('swim_stroke', $pFFA->data_mesgs['length']['swim_stroke'][$active_length]).' | '; echo ''; echo ' |
'.($i+1).' | '; echo ''.$dur.' | '; echo '- | '; echo 'Rest | '; echo '