Problems with PHP 7.3.6
- Function ereg() has been removed
- Support for REQUEST_URI seems to depend on configureation of Apache
Function ereg() is has been removed
to test for digits
ctype_digit($nr);
But take note that before PHP 5.1.0 ctype_digit()
treats an empty string as a number.
PHP Notice:
Undefined index: SCRIPT_URI
To create replacement for $_SERVER['SCRIPT_URI']
function server_protocol() {#https://core.trac.wordpress.org/ticket/47005
$p = isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : '';
return explode("/",$p)[0]; #3rd argument odd so leave out
}
function script_uri() {
$protocol = server_protocol();
$host = $_SERVER['HTTP_HOST'];
$uri = $_SERVER['PHP_SELF'];
return "$protocol://$host$uri";
}
Created 3 July 2019 by W.Langdon