title: Why doesn't file_exists() work?
body: <p>Here is my PHP code:</p>
  
  <pre><code>[root@file htdocs]# vi test.php
  &lt;?php
  
  var_dump(file_exists('/usr/local/apache2/resumes/28/"Chapel Hill"/franky_li/"CV.doc"'));
  ?&gt;
  
  "test.php" [New] 5L, 100C written
  [root@file htdocs]# php test.php 
  bool(false)
  </code></pre>
  
  <p>which says the file doesn't exists,but in fact it does:</p>
  
  <pre><code>[root@file htdocs]# ls -l /usr/local/apache2/resumes/28/"Chapel Hill"/franky_li/"CV.doc"
  -rw-r--r-- 1 daemon root 36864 Oct 17  2008 /usr/local/apache2/resumes/28/Chapel Hill/franky_li/CV.doc
  [root@file htdocs]# 
  </code></pre>
  
  <p>seems it's indeed quote issue:</p>
  
  <pre><code>&lt;?php
  
  
  var_dump(file_exists('/usr/local/apache2/resumes/28/Chapel Hill/franky_li/CV.doc'));
  ?&gt;
  ~
  ~
  "test.php" 5L, 96C written
  [root@file htdocs]# php test.php 
  bool(true)
  [root@file htdocs]# 
  </code></pre>
  
  <p>fixed now by using the following converter:</p>
  
  <pre><code>preg_replace('/\/([^\/\s]+\s+[^\/]+)(?:\/|$)/','/"${1}"/',$file);
  </code></pre>
  
  <p>to make it work in bash!</p>