trying to get my head around if I can call the $_SERVER['SERVER_NAME']
in an img
src
somehow on a PHP page. I'm trying to achieve the following:
<?php
$domain = $_SERVER['SERVER_NAME'];
$dir = '/content/images/';
?>
<html lang="en">
<body>
<img src="<? echo 'https://',$domain,$dir,'logo.png' ; ?>">
Alternatively (if possible)
<img src="<? echo 'https://',$_SERVER['SERVER_NAME'],$dir,'logo.png' ; ?>">
</body>
</html>
I have searched around and tried different ways but can't seem to get it right. Is it possible?