For example, next 2 vars give a link to same directory, but strings are different.
How can I detect they means same directory?$开发者_高级运维dir1 = 'application/somedir/some_subdir/../';
$dir2 = 'application/somedir/';
Use realpath()
if (realpath($dir1) == realpath($dir2)) {
do_stuff();
}
See http://php.net/manual/en/function.realpath.php
You may also want to check that the directories exists before use it.
精彩评论