Handle filename with spaces in system function
<p>I have this code to detect the file charset.</p>

<pre><code>$result = exec('file -i ' . $fromFile);
</code></pre>

<p>The result will be something like: "perk.csv: text/plain; charset=us-ascii"</p>

<p>All is well until $fromFile holds the filename which has spaces on it. Then it complains it could not read the file.</p>

<p>My first solution is to replace any space character with "\ ". But maybe there is a better way to solve this? I feel that I may miss something here.</p>
