HTTP or HTTPS
if (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off'
|| $_SERVER['SERVER_PORT'] == 443) {
// HTTPS
} else {
// HTTP
}
if (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off'
|| $_SERVER['SERVER_PORT'] == 443) {
// HTTPS
} else {
// HTTP
}
Thank you so much for this… I’ve been trying to do something similar for the last 2 weeks… can’t believe I’ve just found this now!!