you will be able to see the request header under the $_SERVER super global, converted the key to uppercase, with prefix HTTP_ & replacing - to _
for example:
X-foo-bar: baz
will be under:
$_SERVER['HTTP_X_FOO_BAR']
The following request:
curl -i 0:9000/test.php -H 'X-foo-bar: baz'
will return:
HTTP/1.1 200 OK
Host: 0:9000
Date: Wed, 27 Jan 2021 21:33:33 GMT
Connection: close
X-Powered-By: PHP/7.3.24
Content-type: text/html; charset=UTF-8
baz
PHP (test.php):
<?php
echo ($_SERVER['HTTP_X_FOO_BAR']);
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…