Simple question on a PHP variable to change and localize the output
<p>how can I change the output of the following to something like <code>2 hours and 30 minutes</code>? </p>

<p>The current output is <code>'hours':02,'mins':30</code></p>

<p>Also how can I change hours to my language? (greek)</p>

<pre><code>function time_difference($endtime){
    $times=array(
        'hours' =&gt; date("G",$endtime),
        'mins' =&gt; date("i",$endtime),
    );

    //added a "just a moment ago" feature for you
    if (intval($times['hours'], 10) == 0 
           &amp;&amp; intval($times['mins'], 10) == 0) {
        return "just a moment ago";
    } 

    $diff='';
    foreach ($times as $k=&gt;$v) {
        $diff.=empty($diff) ? '' : ',';
        $diff.=intval($v, 10) == 0 ? '' : "'$k':$v";
    }

    return $diff;
}   
</code></pre>
