title: Converting Seconds and Duration to SRT (subtitle) time format (PHP)
body: <p>I have an input like like this:</p>
  
  <pre><code>start: 10 | duration: 1 | text: Subtitle Text 1 
  start: 15 | duration: 2 | text: Subtitle Text 2 
  start: 20 | duration: 3 | text: Subtitle Text 3
  </code></pre>
  
  <p>It's a subtitle instruction set, that says following:</p>
  
  <pre><code>At 10 second of the video, show "Subtitle Text 1" for 1 seconds
  At 15 second of the video, show "Subtitle Text 2" for 2 seconds
  At 20 second of the video, show "Subtitle Text 3" for 3 seconds
  </code></pre>
  
  <p>This input needs to be converted into SRT format, so it becomes something like this:</p>
  
  <pre><code>1
  00:00:10,000 --&gt; 00:00:11,000
  Subtitle Text 1
  
  2
  00:00:15,000 --&gt; 00:00:17,000
  Subtitle Text 2
  
  3
  00:00:20,000 --&gt; 00:00:23,000
  Subtitle Text 3
  </code></pre>
  
  <p>Would it be possible for someone to show me how would you go about converting any given seconds value into SRT format (00:00:00,000) by using PHP?</p>
  
  <p>That's all I really need, the rest I can figure out myself.</p>
  
  <p>Thanks, much appreciated.</p>