Sets outgoing header.
public static sendHeader ( string $header, boolean $replace = true ) | ||
$header | string | The header. |
$replace | boolean | Whether to replace existing or not. |
In this example, we are using the sendHeader function to set the Content-Type header to application/json.
Example #2: Setting the Cache-Control headerIn this example, we are using the sendHeader function to set the Cache-Control header to allow caching for up to one hour (3600 seconds) and require revalidation. The Piwik library is a package library that is developed by the Piwik team and provides a set of functions and classes for interacting with the Piwik analytics platform. The Common class, which contains the sendHeader function, is a part of this library.
public static sendHeader ( string $header, boolean $replace = true ) | ||
$header | string | The header. |
$replace | boolean | Whether to replace existing or not. |