+2 votes
8 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.1k points)   | 8 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 | 26 views
+2 votes
0 answers
+2 votes
0 answers
asked Jun 17 by abrishnoor (1.7k points) | 15 views
+3 votes
0 answers
asked Jun 17 by noor (1.1k points) | 3 views
+3 votes
0 answers
+2 votes
0 answers
asked Jun 20 by athar (2.5k points) | 8 views




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.
106 questions
75 answers
36 comments
93 users