Here is what i have come up but still any suggestions would be highly appreciated
/**
* RFC 2616 header value http://greenbytes.de/tech/webdav/draft-ietf-httpbis-p1-messaging-22.html#rfc.section.3.2.4.p.3
* word = token / quoted-string
* token = 1*tchar
* tchar = "!" / "#" / "$" / "%" / "&" / "'" / "*"
* / "+" / "-" / "." / "^" / "_" / "`" / "|" / "~"
* / DIGIT / ALPHA
* ; any VCHAR, except special
* special = "(" / ")" / "<" / ">" / "@" / ","
* / ";" / ":" / "\" / DQUOTE / "/" / "["
* / "]" / "?" / "=" / "{" / "}"
*/
private function isValidHeaderValue($value)
{
$tchar = preg_replace('/[\"][@<>?={}\[\]()\"\,\;\:\/\\\\][\"]+/', '', $value);
$remaining = preg_replace('/[a-zA-Z0-9\s\"!#$%&\'*+-.^_`|~]+/', '', $tchar);
return ($remaining) ? false : true;
}