What does this code mean?

Source: Internet
Author: User
What does this code mean? & Lt ;? Php $ host & nbsp; = & nbsp; $ _ SERVER ['http _ host']; $ HOST & nbsp; = & nbsp; substr ($ host, & nbsp; 0, & nbsp; strpos ($ host, & nbsp ;'. 12. what does this code mean?
 
$ Host = $ _ SERVER ['http _ host'];
$ Host = substr ($ host, 0, strpos ($ host, '.123.baidu.com '));

If (! Empty ($ host ))
{
Include ('task. php ');
}
Else
{
Include ('click. php ');
}



What does this code mean? Not understanding too much
Get host header
In the second sentence, delete ".123.baidu.com" or do you get anything?
The following if does not understand, if (! Empty ($ host) if the host is empty? Execute task. php or click. php.
Is that true?
------ Solution --------------------
In the second sentence, delete ".123.baidu.com" or do you get anything?
---- Yes, you know echo $ host;

The if below is very simple. In fact, it is to determine whether it is a third-level domain name.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.