podlove / normalplaytime
PHP parser for Normal Play Time (RFC 2326)
Installs: 4 855
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 18
Forks: 0
Open Issues: 0
Requires
- php: >=5.3.0
Requires (Dev)
- phpunit/phpunit: 3.7.*
This package is auto-updated.
Last update: 2024-11-27 04:20:57 UTC
README
PHP parser for Normal Play Time (RFC 2326)
Usage
<?php use \Podlove\NormalPlayTime\Parser; // get seconds or milliseconds Parser::parse("1.834"); // 1834 Parser::parse("1.834", "s"); // 1 // invalid returns NULL Parser::parse("abc"); // NULL // valid example NPT strings Parser::parse("1"); // 1000 Parser::parse("12:34"); // 754000 Parser::parse("12:34.56"); // 754560 Parser::parse("1:2"); // 62000 Parser::parse("1:2:3.4"); // 3723400