Detecting 301 Redirect using PHP?

Jeff-DBA

New member
What I know: URL (either http:// or http://www)

What I need: When I visit the page using the http://, am I being 301 redirected to the [URL="http://www/"]http://www[/URL] version of the domain?

This is obviously easy to tell just by looking up, or at the http headers. However, I'm trying to do it with PHP.

So imagine a function


function($url){
$redirect = false;
if redirected{
$redirect = true;
}
return $redirect
}

Is there a php function or quick little fix for this problem that anyone knows about?

Thanks in advance for any comments