Was helping a friend fix his php script today. He was not too sure about what “dirname(__FILE__)” did.
dirname() is a PHP function which returns the directory name of a file. For example if file abc.txt was in “/tmp/abc.txt” then the dirname() function would return “/tmp” .
Example Usage;
<?php
$file = “/tmp/abc.txt”;
$path = dirname($file); // $path will now [...]