title: How to match 12h time in text string
body: <p>I have the strings below in a feed. I need to match the bold portion and store it in a variable:</p>
  
  <ol>
  <li>Ramdom Event Name <strong>12:30PM to 1:30PM</strong></li>
  <li>Ramdom Event Name again <strong>2:30PM</strong></li>
  </ol>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>I used the solution provided by @cryptic. </p>
  
  <p>Here are the result: </p>
  
  <pre><code> $titles = array( 
                  "*~Svet~* 12:30PM to 1:30PM",
                  "Basketball (M and W) vs Cleveland State 6:00PM",
                  "Christmas for the Kids Celebration! 2:00PM to 4:00PM"
              );
  
  foreach ($titles as $title) {
      //get date
      preg_match('/(\d{1,2}:\d{2}[ap]m)( to \d{1,2}:\d{2}[ap]m)?/i', $title, $match);
      //get title
      $cleanTitle = preg_split('/([0-1][0-9]|[0-9]):?([0-5][0-9])/', $title);
  
  echo "&lt;p&gt;Title: ".$cleanTitle[0]."&lt;br /&gt;Time: ".$match[0]."&lt;/p&gt;"; 
  
  }
  </code></pre>
  
  <p><strong>//Output</strong></p>
  
  <p>Title: <em>~Svet~</em><br />Time: 12:30PM to 1:30PM</p>
  
  <p>Title: Basketball (M and W) vs Cleveland State<br />Time: 6:00PM</p>
  
  <p>Title: Christmas for the Kids Celebration!<br />Time: 2:00PM to 4:00PM</p>