Home >Backend Development >PHP Tutorial >php $_SERVER The difference between windows system and linux system_PHP tutorial

php $_SERVER The difference between windows system and linux system_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 10:25:04987browse

These are some differences I discovered in the process of building a corporate website: (for reference only)

1. $_SERVER['SERVER_NAME'] Under Windows system, there is / at the end, but there is no / under Linux. The following methods can be used to deal with it

1. No matter what kind of system it is, just add / and then replace it. Remember, str_replace('\', '/', $fileUrl); should be replaced like this.

2. To determine what kind of operating system it is, use PHP_OS, and then intercept characters to determine.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/825217.htmlTechArticleThese are some differences I found in the process of building a corporate website: (for reference only) 1. $_SERVER ['SERVER_NAME'] Under Windows system, there is / at the end, but there is no / under Linux. Available below...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn