Feeding Times
There are three kittens, Chloe, Simba, and Bella; who have a busy week full of sleeping and eating. A schedule of free times from 8am to 6pm, Monday to Friday, for potential owners to visit is needed. Based on the availability as provided below, please write a procedural (no objects) PHP script that takes the given input and outputs a tabular schedule. A sample table schedule is provided below.
Input Data
Sleeping (indicated as 0), eating (indicated as 1), and free (indicated as 2) times from Monday 00:00 to Saturday 00:00 in 30 minute increments for each kitten.
$times = [ 'Chloe' => '000000000000000021002220120000221200000000000000000000000000000022022221122222222200000000000000000000000000000022220212222222222200000000000000000000000000000021002200220000022200000000000000000000000000000022022000222122222200000000000000', 'Simba' => '000000000000000022201200000000222200000000000000000000000000000022212222222222222100222000000000000000000000000022212222222221222200000000000000000000000000000022122222222221222200000000000000000000000000000022022100000001222200000000000000', 'Bella' => '000000000000000022022201220000002220000000000000000000000000000022222222222222012220000000000000000000000000000022000000220000002220000000000000000000000000000021112222222222222220000000000000000000000000000022012222212221222200000000000000', ];
Sample Table Schedule
Time | Chloe | Simba | Bella |
---|---|---|---|
8:00 | Eating | Sleeping | |
8:30 | Sleeping | Sleeping | |
etc. |
Time | Chloe | Simba | Bella |
---|---|---|---|
8:00 | Sleeping | Sleeping | |
8:30 | Sleeping | Eating | |
etc. |