🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.php
Article #232619

$_SERVER vs filter_input_array(INPUT_SERVER)

#232619
From: Jakub
Date: Tue, 09 Apr 2024 10:28
31 lines
1165 bytes
Witam

Mam taki skrypt


<?php

$a = $_SERVER;

foreach (  $a as $k => $v) {
   echo $k . ' => ' . $v . '<br>';
}

echo '<hr><br>';

$b = filter_input_array(INPUT_SERVER);

foreach (  $b as $k => $v) {
   echo $k . ' => ' . $v . '<br>';
}


Niby wyniki są podobne, ale jest różnica

$_SERVER ma takie klucze jak: REQUEST_TIME_FLOAT, REQUEST_TIME

a to filter_input_array(INPUT_SERVER) nie ma tych kluczy

Jak to rozwiązac ?

Pozdrawiam Jakub
Technical Details
Message-ID: <uv358b$10r00$1@news.icm.edu.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!.POSTED.public-gprs403024.centertel.pl!not-for-mail

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!.POSTED.public-gprs403024.centertel.pl!not-for-mail
From: Jakub <jak74@interia.pl>
Newsgroups: pl.comp.lang.php
Subject: $_SERVER vs filter_input_array(INPUT_SERVER)
Date: Tue, 9 Apr 2024 12:28:30 +0200
Organization: ICM, Uniwersytet Warszawski
Message-ID: <uv358b$10r00$1@news.icm.edu.pl>
Mime-Version: 1.0
Injection-Date: Tue, 9 Apr 2024 10:28:28 -0000 (UTC)
Injection-Info: news.icm.edu.pl; posting-host="public-gprs403024.centertel.pl:37.47.205.145"; logging-data="1076224"; mail-complaints-to="usenet@news.icm.edu.pl"
User-Agent: Mozilla Thunderbird
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit