Created
September 4, 2012 01:55
-
-
Save 1000k/3615690 to your computer and use it in GitHub Desktop.
Frequently-appearing phrases which relate to paths.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Frequently-appearing phrases which relate to paths. | |
$paths = array( | |
array('__FILE__', __FILE__), | |
array('realpath(__FILE__)', realpath(__FILE__)), | |
array('dirname(__FILE__)', dirname(__FILE__)), | |
array('basename(__FILE__)', basename(__FILE__)), | |
array('pathinfo(__FILE__)', pathinfo(__FILE__)), | |
array('__DIR__', __DIR__), | |
); | |
foreach ($paths as $row) { | |
echo "{$row[0]}:\t"; | |
if (is_array($row[1])) { | |
print_r($row[1]); | |
} else { | |
echo "{$row[1]}\n"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you put this script in C:\work\htdocs\sandbox\paths.php, for example, the result is following: