mexoboy/sub-rip

SubRip parser

dev-master 2020-02-09 22:01 UTC

This package is auto-updated.

Last update: 2025-06-10 10:24:47 UTC


README

Simple library for parsing subtitles in SubRip format.

Library support 2 ways for reading file: read as stream and read from string. By default, all readers use strict mode, but it can be off, to avoid errors in reading non-valid subtitles.

Example for String Reader:

$stringReader = new StringReader($subRipData);

foreach ($stringReader as $record) {
    echo $record->getContent() . "\n";
}

Example for Stream Reader:

$stringReader = new StringReader($subRipData);

foreach ($stringReader as $record) {
    echo $record->getContent() . "\n";
}