Home  >  Article  >  Backend Development  >  __FILE problem_PHP tutorial

__FILE problem_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 10:51:26855browse



Question
Question about __FILE
Solution
define('ROOT', dirname(__FILE__));


Copy the code such as a file I created
Tested it
Direct __FI:E__ is
D:AppServwwwminlogtest.php
If again
require_once(ROOT.'/config.php');

That's not possible D:AppServwwwminlogtest.php./config

What is this result used for?

[ ]


Reference answer
dirname(__FILE__)=D:AppServwwwminlog
I really don’t know how you understand...
Do you think it’s useful????
Reference answer
D:AppServwwwminlogtest.php


The result I get is
representing the file name. Reference answer
The original post was published by wodoe on 2009-1-3 23:20 [url=http://bbs.111cn.cn/redirect.php?goto=findpost&pid=814037&ptid=100295]Link tag [img]http://bbs. 111cn.cn/images/common/back.gif[/img][/url]
D:AppServwwwminlogtest.php


The result I get is the file name
Is your computer special? Impossible
echo dirname(__FILE__);
Reference answer
Sorry, the moderator will deduct my coins

Misunderstanding, just __FILE__ [img]http://www.111cn.cn/bbs/images/smilies/default/hug.gif[/img]

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/632576.htmlTechArticleProblem __FILE problem solution define('ROOT', dirname(__FILE__)); Copy the code. For example, I created A file tested directly __FI:E__ is D:AppServwwwminlogtest.php. If...
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