mattwoo/subrip

Subrip file parser for PHP

Maintainers

Package info

github.com/mattwoo/subrip

pkg:composer/mattwoo/subrip

Statistics

Installs: 42

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v0.1.3.3 2016-11-22 13:57 UTC

This package is not auto-updated.

Last update: 2026-03-09 19:47:25 UTC


README

Installation

composer require mattwoo/subrip

Creating srt file

//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();

Reading srt file

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