I have the following line:
<div class='social'>http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]</div>
It's all great and it displays the current link, let's say: http://www.example.com/mypage.php
Now I want to associate this with a variable as such
$myURL = 'http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]'
When I echo this out I get "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]" - in other words the code itself. What am I doing wrong?
I've also tried: $myURL = '{http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]}'
I've also tried echoing it out directly:
echo 'http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]';
What am I overlooking? Thank you!