+2 votes
1.5k views

I have a script where i need to check the $_SERVER[“HTTP_HOST”] to populate another variable

echo "***" .trim($_SERVER['HTTP_HOST']) ."***"; 
// it echoes ***192.168.1.1:5757***

if ( trim($_SERVER['HTTP_HOST']) == "192.168.1.1:5757" ) {
    echo "AAA";
} else {
    echo "BBB";
}
// echo is BBB

I also try using === instead == but it doesn’t seem to work

by (1.3k points)   | 1.5k views

Please log in or register to answer this question.

Related questions

+2 votes
0 answers
+3 votes
0 answers
asked Mar 20 by Rehan | 40 views
+2 votes
0 answers
+2 votes
0 answers
asked Jun 17 by abrishnoor (1.7k points) | 131 views
+3 votes
0 answers
asked Jun 17 by noor (1.1k points) | 9 views
+3 votes
0 answers
+1 vote
1 answer




Welcome to Meansflow - Where Developers and Students Learn, Share, & Build Careers, where you can ask questions and receive answers from other members of the community.
117 questions
88 answers
42 comments
106 users