Check if an HTTP method is allowed by checking the Allow response header
string $method Method to check:
bool
public function isMethodAllowed($method) {
$allow = $this
->getHeader('Allow');
if ($allow) {
foreach (explode(',', $allow) as $allowable) {
if (!strcasecmp(trim($allowable), $method)) {
return true;
}
}
}
return false;
}