Created
March 12, 2014 03:26
-
-
Save yasuken1990/9500257 to your computer and use it in GitHub Desktop.
driname(), getcwd() 関数の違い。
This file contains 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 | |
// homeディレクトリで行ってください | |
echo '1. __FILE__' . PHP_EOL; | |
echo '2. dirname(__FILE__)' . PHP_EOL; | |
echo '3. getcwd()' . PHP_EOL; | |
echo '4. chdir(\'.ssh/\')' . PHP_EOL; | |
echo '5. __FILE__' . PHP_EOL; | |
echo '6. dirname(__FILE__)' . PHP_EOL; | |
echo '7. getcwd()' . PHP_EOL; | |
echo PHP_EOL; | |
echo '1. ' . __FILE__ . PHP_EOL; | |
echo '2. ' . dirname(__FILE__) . PHP_EOL; | |
echo '3. ' . getcwd() . PHP_EOL; | |
//exec('ls -l', $fileAll); | |
//print_r($fileAll); | |
chdir('.ssh/'); | |
echo '4. ' . '** chdir(\'.ssh/\') を実行し、ワークングディレクトリが.ssh/ に変わる **' . PHP_EOL; | |
//exec('ls -l', $fileAll); | |
//print_r($fileAll); | |
echo '5. ' . __FILE__ . PHP_EOL; | |
echo '6. ' . dirname(__FILE__) . PHP_EOL; | |
echo '7. ' . getcwd() . PHP_EOL; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment