PHP Opendir() paths containing spaces
<p>I want to open a directory on linux file system using the <code>opendir()</code> PHP function. </p>

<p>The path might contain spaces or some other special characters. </p>

<p>While I am trying to open the directory I get:</p>

<pre><code>Warning: opendir(/home/user/_demo/test/salamis\ test): failed to open dir: No such file or directory
</code></pre>

<p>I firstly tried to replace the space character with <code>\</code> (slash space) using:</p>

<pre><code>str_replace(" ","\ ","salamis test");
</code></pre>

<p>But unfortunately is not working. Any suggestions? </p>
