php_DIRECTORY_SEPARATOR 和 PATH_SEPARATOR

WBOY
Release: 2016-06-23 13:39:22
Original
871 people have browsed it

DIRECTORY_SEPARATOR 和 PATH_SEPARATOR

DIRECTORY_SEPARATOR:目录分隔符,linux上就是’/’    windows上是’\’

 

PATH_SEPARATOR:路径分隔符,include多个路径使用,在win下,当你要include多个路径的话,你要用”;”隔开,但在linux下就使用”:”隔开的。

 

=================================================

 

 

zendframework include 设置 index.php

 

set_include_path('.' . PATH_SEPARATOR . '../library/' . PATH_SEPARATOR . './application/models/'

. PATH_SEPARATOR . './application/lib/'

. PATH_SEPARATOR . get_include_path());

 

PATH_SEPARATOR是一个常量,在Linux系统中是一个" : "号,Windows上是一个" ; "号。所以编写程序时最好用常量 PATH_SEPARATOR 代替,否则如果系统从linux移植到win系统或反过来移植会出错!

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