如何检查是否在Windows或Linux或其它操作系统上code环境 [英] How to check whether your code environment on Windows or on Linux or other OS
问题描述
现在,我code定义单词preSS主题,并在XAMPP Windows XP中测试它的Apache服务器上。但只要我的关注,有没有WP内置的功能来确定code环境。是否有任何PHP内置的功能,以确定这样的事情?
right now, i code custom wordpress theme and testing it in xampp windows XP on apache server. But as long as i concern, there's no wp build-in function to identify the code environment. Is there's any PHP build-in function to identify such thing ?
备案,我想code需要读取一个目录。在我的阿帕奇(在Windows),路径为c:/ XAMPP / htdocs中,其中在Linux上的Apache将\\ somepath \\ somepath \\
for the record, what i want to code need to read a directory. in my apache (in windows), the path will be c:/xampp/htdocs where apache on linux will be \somepath\somepath\
那么,有没有code解决方案,知道什么是操作系统环境,而我需要检索和比较的路径?我希望它也将在其他操作系统与其他网络服务器工作,然后APACHE如IIS
so, is there any code solution to know what is the OS environment without i have to retrieve and compare the path ? i hope it will also work on other OS with other webserver then APACHE such as IIS
推荐答案
您想 php_uname()
对于这一点,并有可能的 php_sapi_name()
。
这篇关于如何检查是否在Windows或Linux或其它操作系统上code环境的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!