views:

60

answers:

2

The title says it all. I have symlinks to certain directories because the directories' names have non English characters that I got fed up trying to get apache's rewrite rules to match. There's a bounty on that question http://stackoverflow.com/questions/2916194/trouble-with-utf-8-chars-apache2-rewrite-rulesif anyone wants to go for it, and from the looks of things a lot of people would like to see a general solution to this problem, but meanwhile I made a plain ascii symlink to each of these offending directories. Now the rewrite rules are back to just alpha and _ and - and my security concerns are less and it loads the resources I want. But I still need the actual target directory name for display purposes. I googled "PHP directory info, PHP symlink" but didn't find anything. I need to do something like this:

if (is_symlink($myResDirName)) {
    $realDirName = follow_symlink($myResDirName);
}
+3  A: 

You're looking for is_link

Matt
That's what you are looking for.If you need to find things like these in the future, consider googling something like "php symlink"..in this case you are taken to the symlink function on the oficial PHP website..then, at the end of each function description you have "related functions".. you can jump between them to see if any fit your needs.At least it was like this that i found this function too ;)
Gonçalo Queirós
I tried is_symlink too. Bad on me for not thinking of the right keywords and for missing the fine print at the bottom. Usually if it's in php.net I find it. And thanks!