PHP - Need help with some string functions
<p>I am trying to write a script to pull schedule data out of a database used at work.</p>

<p>The employees working times are stored daily as a string like this</p>

<pre><code>000000000000000000000000000000001111111111111111111111111111111111111111000000000000000000000000
</code></pre>

<p>Every character represents 15 min.  The first character space is 12:00 AM second is 12:15 AM and so on....</p>

<p>The example above the employee works 8:00 - 6:00.</p>

<p>I created an array like this for every character position.</p>

<pre><code>$time[0] = "12:00";
$time[1] = "12:15";
$time[2] = "12:30";
$time[3] = "12:45";
$time[4] = "1:00";
$time[5] = "1:15";
$time[6] = "1:30";
$time[7] = "1:45";
$time[8] = "2:00";
</code></pre>

<p>and I can display the employees time like this </p>

<pre><code>echo $time[strpos($string, '1')] . "-" . $time[strpos($string, '0', strpos($string, '1'))];
</code></pre>

<p>but I cannot figure out how to make this work if someone has a split shift, such as 9:30 - 2:00 / 4:00 - 7:00</p>

<pre><code>000000000000000000000000000000000000001111111111111111110000000011111111111110000000000000000000
</code></pre>

<p>Sorry if my English is poor.</p>

<p>Thanks</p>
