mattwoo / subrip
Subrip file parser for PHP
Installs: 42
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/mattwoo/subrip
This package is not auto-updated.
Last update: 2025-10-20 18:14:03 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);