php function to show time in digital clock format
<p>I have created a php function to return time in digital clock format. My function is</p>

<pre><code>function get_hh_mm_ii($unsorted_time) {
    //return $unsorted_time;
    if ($unsorted_time == '00:00') {
        return 'x';
    } elseif ($unsorted_time != '00:00') {

        $time = explode(":", $unsorted_time);
        $hh   = $time[0];
        $mm   = $time[1];

        //var_dump($hh/12); exit();

        if (($hh / 12) == 0) {
            $ii = 'am';

            return $hh . ':' . $mm . ' ' . $ii;

        } elseif (($hh / 12) == 1) {
            $ii = 'pm';
            $hh = $hh % 12;
            if ($hh == 0) {
                $hh == 12;
            }
            return $hh . ':' . $mm . ' ' . $ii;
        }
    }
}
</code></pre>

<p>When I tried to pass value (02:03) or any other it always returns NULL. I checked its value using var_dump. </p>
