dir manipulation(__DIR__) not working
the following behaves different in host:
echo 'DIR:' .__DIR__; // DIR:__DIR__
localhost:(works fine):
开发者_如何学PythonDIR:C:\Program Files\VertrigoServ\www
why this different output?
You need PHP 5.3 to use __DIR__
Manual page
On previous versions you may use dirname(__FILE__)
instead
According to the PHP magic constants docs, the __DIR__
constant was added only in php 5.3.0. You're probably using an older version in your "host" environment.
Try:
<? echo realpath(dirname(__DIR__)); ?>
Folder: localhost or root :)
精彩评论