Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Send a raw HTTP header
<?php header(string $header, bool $replace = true, int $response_code = 0): void
<?php } else {
header('Content-Type: ' . $mime);
header('Content-Length: ' . $length);
$response = $data;
}
<?php } else {
header('Content-Type: ' . $mime);
header('Content-Length: ' . $length);
$response = $data;
}
<?php if ($issues) {
if (!headers_sent()) {
header('HTTP/1.1 500 Internal Server Error');
}
if (!ini_get('display_errors')) {
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
<?php if ($issues) {
if (!headers_sent()) {
header('HTTP/1.1 500 Internal Server Error');
}
if (!ini_get('display_errors')) {
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
<?php if ($issues) {
if (!headers_sent()) {
header('HTTP/1.1 500 Internal Server Error');
}
if (!ini_get('display_errors')) {
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
<?php if ($issues) {
if (!headers_sent()) {
header('HTTP/1.1 500 Internal Server Error');
}
if (!ini_get('display_errors')) {
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
<?php if ($issues) {
if (!headers_sent()) {
header('HTTP/1.1 500 Internal Server Error');
}
if (!ini_get('display_errors')) {
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
<?php if ($issues) {
if (!headers_sent()) {
header('HTTP/1.1 500 Internal Server Error');
}
if (!ini_get('display_errors')) {
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
<?php if ($issues) {
if (!headers_sent()) {
header('HTTP/1.1 500 Internal Server Error');
}
if (!ini_get('display_errors')) {
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
<?php function dd(...$vars)
{
if (!in_array(\PHP_SAPI, ['cli', 'phpdbg'], true) && !headers_sent()) {
header('HTTP/1.1 500 Internal Server Error');
}
foreach ($vars as $v) {
<?php if (isset($_GET['img'])) {
$fp = fopen('https://bref.sh/img/logo-small.png', 'rb');
header('Content-Type: image/png');
fpassthru($fp);
exit(0);
}
<?php }
if (isset($_GET['json'])) {
header('Content-Type: application/json');
echo json_encode(['Hello' => '🌍']);
exit(0);
}
<?php }
if (isset($_GET['weird'])) {
header('Content-Type: foo/bar');
echo 'Hello 🌍';
exit(0);
}
<?php <?php declare(strict_types=1);
if ($_GET['extensions'] ?? false) {
header('Content-Type: application/json');
echo json_encode(get_loaded_extensions(), JSON_PRETTY_PRINT);
return;
}
<?php }
if ($_GET['php-config'] ?? false) {
header('Content-Type: application/json');
echo json_encode(ini_get_all(null, false), JSON_PRETTY_PRINT);
return;
}