PHP code example of mattwoo / subrip

1. Go to this page and download the library: Download mattwoo/subrip 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/ */

    

mattwoo / subrip example snippets


//Create subtitle position
$position = new \Mattwoo\Subrip\SubripPosition(100, 200, 100, 200);
//Create next subtitle row (single subtitle)
$row = new \Mattwoo\Subrip\SubripRow(1 '00:00:00.000', '00:00:10.000', 'text', $position);
//Create new subrip fle
$file = new \Mattwoo\Subrip\SubripFile();
//Add row to file
$file->addRow($row);
//Get created file content as string
$fileContent = $file->__toString();

//Parse file into SubripFile object
$file = new \Mattwoo\Subrip\SubripFile($content);