Code Show:
1<! DOCTYPE HTML Public"-//W3C//DTD XHTML 1.0 transitional//en" "HTTP://WWW.W3.ORG/TR/XHTML1/DTD/XHTML1-TRANSITIONAL.DTD">2"http://www.w3.org/1999/xhtml"xml:lang="ZH-CN">34<meta http-equiv="Content-type"Content="Text/html;charset=utf-8"/>5<title> Page Title </title>6<meta name="keywords"Content="keyword list"/>7<meta name="Description"Content="Web Page Description"/>8<link rel="stylesheet"Type="Text/css"href=""/>9<style type="Text/css"></style>Ten<script type="Text/javascript"></script> One A<body> -<?PHP - //set the value of Include_path in the configuration file-the settings in the code are only valid for the current code. the //and the settings here, no need to restart Apache . -Set_include_path ('D:\00-Code\PhpStorm\Demo\demo01'); - - //the more common approach: +$path = Get_include_path ();//get the Include_path value of the system first -$path _new = $path. Path_separator."c:/"; + //Path_separator: is a system constant that represents a directory separator: A //UNIX series, is ":" at //window series, is ";" -Set_include_path ($path _new);//then set the PAHT path you want to join. - //this will not destroy (lost) the original path settings - -Echo"<p> Current working directory:". GETCWD ().'</p>';//GETCWD () get the current working directory - in //relative path: - //include ' c.php '; to +?> -</body> the
Results show:
Current working directory: D:\00-Code\PhpStorm\Demo\demo01
PHP, Set_include_path