Look at the code below
echo "$_SERVER['HTTP_HOST']";
it show ‘Parse error’, while the next shows ok
$str = $_SERVER['HTTP_HOST'];
echo "$str";
That was very strange to me.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
to refer an associative array inside of a string, you have to either add curly braces or remove quotes:
both
would work
http://php.net/manual/en/language.types.string.php <- extremely useful reading