srt25t24

Download:

<?php
/*

Setup the input and ouput file within the script.
Start the script by e.g. "php srt25t24.php"

To use the script vice versa you'll have to update the FACTOR constant to "24/25".

*/
$input_file = "";
$output_file = "";

define("FACTOR", (25/24));

$i = file_get_contents($input_file);
$o = $output_file;
setlocale(LC_TIME, "C");
date_default_timezone_set('UTC');
function raise($val){
	$tmp0 = explode(":", $val);
	$tmp1 = explode(",", $tmp0[2]);
	$hours = $tmp0[0];
	$minutes = $tmp0[1];
	$seconds = $tmp1[0];
	$milsecs = $tmp1[1];
	$tmp2 = $seconds + ($minutes * 60) + ($hours * 60 * 60) + ($milsecs / 1000);
	$tmp3 = $tmp2 * FACTOR;
	$tmp3 = round($tmp3, 3);
	$tmp4 = explode(".", $tmp3);
	if (count($tmp4) < 2){ $tmp4[1] = "0"; }
	$tmp4[1] = str_pad($tmp4[1], 3, "0", STR_PAD_RIGHT);
	$tmp5 = strftime("%H:%M:%S,", $tmp4[0]);
	$tmp6 = $tmp5.$tmp4[1];
	return $tmp6;
	}
$tmp00 = explode("\n\n", $i);
$result = "";
foreach ($tmp00 as $k1 => $v1){
	if ($v1 == ""){ continue; }
	$tmp01 = explode("\n", $v1, 3);
	$tmp02 = explode(" --> ", $tmp01[1]);
	$from = trim($tmp02[0]);
	$to = trim($tmp02[1]);
	$number = trim($tmp01[0]);
	$content = trim($tmp01[2]);
	$result .= $number."\n".raise($from)." --> ".raise($to)."\n".$content."\n\n";
	}
file_put_contents($o, $result);
echo "success";
?>

documentation.txt -> unavailable, yet. Please be patient.
license.txt

This product includes/requires PHP software, freely available from
http://www.php.net/software/

<<< back