__FILE__ is simply the name of the current file. realpath(dirname(__FILE__)) gets the name of the directory that the file is in -- in essence, the directory that the app is installed in. And @ is PHP's extremely silly way of suppressing errors.
php $path = "C:\\test_folder\\folder2\\folder4"; $sub_folder = scandir($path); $num = count($sub_folder); for ($i = 2; $i < $num; $i++) { if(is_file($path.
PHP dirname() Functionecho dirname("c:/testweb/home. php", 2) . "<br />"; echo dirname("/testweb/home.
echo __FILE__;
gives me: C:\EasyPHP-DevServer-13.1VC9\data\localweb\projects\FOLDERNAME\index.php
I just want to get file name without its path. I want to get index.php on its own.
Any ideas?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With