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

WBOY
Release: 2016-07-13 10:25:04
Original
948 people have browsed it

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...
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!