I recently was seeking a way to properly determine protocol, under which url request was supplied to the server.
I watched through parse_url()
and though $_SERVER
superglobal variable, and found this:
<?php
header('Content-Type: text/plain');
print_r($_SERVER);
Output:
[REQUEST_SCHEME] => http
However, I was unable to find it on php.net or Google. Though, I was able to find this question. Q#1: If $_SERVER['REQUEST_SCHEME']
wasn't documented, then it is probably unreliable, or it can be trusted?
I'am using VC9 PHP 5.4.14 TS
under windows for development. But my production is under ubuntu. Q#2: Is this property also availible under ubuntu linux too?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…