Slashes and backslashes uniformity on UNIX / Windows
<p>I'm writing a PHP class, and I want it to be cross-platform compatible. I need to explode a path to find a particular folder name. What do I choose for the delimiter? The path will contain '/' on UNIX and '\' on Windows.</p>

<p>In this particular example, I want to get the name of the directory where an included file is stored. I use this :</p>

<pre><code>private function find_lib_dir() {
    $array_path = explode('/', __DIR__);
    return $array_path[count($array_path)-1];
}
</code></pre>

<p>In this situation (and more generally), what can I do to make sure it will work on both Windows and UNIX?</p>

<p>Thanks!</p>
