Skip to content

Latest commit

 

History

History
28 lines (21 loc) · 970 Bytes

File metadata and controls

28 lines (21 loc) · 970 Bytes

Duration

The object is created to represent the duration of a media file. The duration can then be output in H:i:s format

Property List

Data type Property Description
int duration The duration in milliseconds

Function List

Visibility Function (parameters,...): return
public __construct(int $duration): void
public minutes(): string
The duration represented in minutes
public seconds(): string
The duration represented in seconds
public __toString(): string
Auto convert the object to a string and output in H:i:s format

|

Examples

$dur = new Duration(20152000);
print $dur->seconds().PHP_EOL; // 20152
print $dur->minutes().PHP_EOL; // 335
print (string) $dur; // 05:35:52