কম্পিউটার টিউটোরিয়াল

PHP $http_response_header


ভূমিকা

সুপারগ্লোবাল $http_response_header অ্যারে HTTP রেসপন্স হেডার দিয়ে পপুলেট হয়, ঠিক get_headers() ফাংশনের মতো। এই অ্যারে PHP-এর লোকাল স্কোপে তৈরি হয়।

$http_response_header

উদাহরণ

<?php file_get_contents("https://localhost"); $arr = $http_response_header; foreach ($arr as $key => $val) echo "<p>$key => $val </p>"; ?>

আউটপুট

ব্রাউজারে নিচের সাদৃশ্য ফলাফল দেখাবে—

0 => HTTP/1.1 302 Found 1 => Date: Tue, 08 Sep 2020 14:49:24 GMT 2 => Server: Apache/2.4.41 (Win64) OpenSSL/1.0.2s PHP/7.1.32 3 => X-Powered-By: PHP/7.1.32 4 => Location: https://localhost/dashboard/ 5 => Content-Length: 0 6 => Connection: close 7 => Content-Type: text/html; charset=UTF-8 8 => HTTP/1.1 200 OK 9 => Date: Tue, 08 Sep 2020 14:49:24 GMT 10 => Server: Apache/2.4.41 (Win64) OpenSSL/1.0.2s PHP/7.1.32 11 => Last-Modified: Mon, 02 Sep 2019 15:45:31 GMT 12 => ETag: "1d99-59193dc9c3cc0" 13 => Accept-Ranges: bytes 14 => Content-Length: 7577 15 => Connection: close 16 => Content-Type: text/html

  1. PHP HTTP কনটেক্সট অপশনস

  2. PHP ট্যাগস (PHP Tags)

  3. PHP pi() ফাংশন

  4. PHP-এ XML ফাইল ইচো করা