Archive for the ‘PHP’ Category

Http Codes explained

This item was filled under [ Basic, Default, HTML, PHP ]

HTTP CODES 100-101

100
Continue
Tells the client that the first part of the request has been received and that it should continue with the rest of the request or ignore if the request has been fulfilled.

101
Switching Protocols
Tells the client that the server will switch protocols to that specified in the Upgrade message header field during the current [...]

Continue reading...

Tagged with: [ , , , ]

View hidden files with Zend Studio 6

This item was filled under [ Default, PHP ]

I usually code with Zend Studio 5.5, but since has been released the 6′th version (and now the 7′th Beta), I must use the 6′th version. Honestly, I don’t like this version. For me, ZS 5.5 is the best, but I have to work with this too.
Ok, now let’s get to the point. I have [...]

Continue reading...

Tagged with: [ , , , , ]

Seconds to Hour : minutes : seconds

This item was filled under [ PHP ]

Seconds to Hour : minutes : seconds
function sec_to_time($sec)
{
$hr = 0;
$min = 0;
$time = array();
while (floor($sec/3600) > 0)
{
$hr++;
$sec-=3600;
}
while (floor($sec/60) > 0)
{
$min++;
$sec-=60;
}
$time['h'] = ($hr < 10) ? “0″.$hr : $hr;
$time['m'] = ($min < 10) ? “0″.$min : $min;
$time['s'] = ($sec < 10) ? “0″.$sec : $sec;
return $time;
}

Example:
$ora = sec_to_time(1400); // 1400 seconds
echo $ora['h'].” : ”.$ora['m'].” : ”.$ora['s'];
// 00 : 23 : 20
// that means 23 minutes and 20 seconds

Continue reading...

Tagged with: [ , , , , , ]
Update me when site is updated