Archive for February, 2011
Twitter Updates
by solomon on Feb.08, 2011, under Uncategorized
I guess it would be kinda cool if my posts are published as twitter entries. I have installed a new plugin. And this is my first post to test it out.
Getting PHP headers without apache mod headers
by solomon on Feb.08, 2011, under php, Programming
It sometimes happen. You are in a restricted environment -like a shared hosting- and somehow you want to reach the custom headers without enabling the apache module “mod_headers”. Than following little function will do your job.
function getHeaders()
{
$headers = array();
foreach ($_SERVER as $k => $v)
{
if (substr($k, 0, 5) == "HTTP_")
{
$k = str_replace('_', ' ', substr($k, 5));
$k = str_replace(' ', '_', strtolower($k));
$headers[$k] = $v;
}
}
return $headers;
}
P.S. If you have the possibility to use the mod_headers, than you’re free to use apache_get_headers() function.