PHP Classes

File: DistanceTime.example.php

Recommend this page to a friend!
  Classes of Tim Charnecki   Distance Time   DistanceTime.example.php   Download  
File: DistanceTime.example.php
Role: Example script
Content type: text/plain
Description: A simple example of the DistanceTime class
Class: Distance Time
Calculate the speed, pace for distances ran
Author: By
Last change:
Date: 16 years ago
Size: 272 bytes
 

Contents

Class file image Download
require_once(DistanceTime.class.php);

// This example calculates splits for a 3 hour marathon.
$rp = new DistanceTime(26.2, 'mi', 0, 0, 3);
echo $rp->getPaceString('min/mi', true) . "\n";
echo $rp->getSpeedString('mi/h', true) . "\n";
var_dump($rp->getAllSplits());