PHP code example of podlove / normalplaytime

1. Go to this page and download the library: Download podlove/normalplaytime library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

podlove / normalplaytime example snippets



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