-
Notifications
You must be signed in to change notification settings - Fork 23
Home
ju edited this page Sep 23, 2013
·
8 revisions
<?php
require('src/SrtParser/srtFile.php');
try{
$file = new \SrtParser\srtFile('./example.srt');
// get the text of the first entry
echo $file->getSub(0)->getText();
}
catch(Exeption $e){
echo "Error: ".$e->getMessage()."\n";
}<?php
require('src/SrtParser/srtFile.php');
try{
$srt = new \SrtParser\srtFile('my_subs.srt');
$srt->setWebVTT(true);
$srt->build(true);
$srt->save('my_subs.vtt', true);
}
catch(Exeption $e){
echo "Error: ".$e->getMessage()."\n";
}