-
Notifications
You must be signed in to change notification settings - Fork 2
Message: hasHeader Example
Terry L edited this page Jun 20, 2020
·
3 revisions
Shieldon\Psr7\Message
Checks if a header exists by the given case-insensitive name.
-
param
string
name*
Case-insensitive header field name. -
return
bool
Example:
if ($message->hasHeader('user-agent')) {
echo 'Header user-agent exists.';
} else {
echo 'Header user-agent does not exist.';
}
// Outputs: Header user-agent exists.
composer require shieldon/psr-http
Shieldon PSR HTTP implementation written by Terry L. from Taiwan.