PHP file_get_contents changing file name
<p>I need to get a file from the server and I'm doing it like this:</p>

<pre><code>file_get_contents($path.$fileName);
</code></pre>

<p>It works well with most of the files, until I started experiencing some issues in particular cases like the following:</p>

<p>Where the <code>$path</code> is a string like this: <code>"/path/to/app/and/file/folder/"</code> (not a url but a realpath)</p>

<p>and <code>$fileName</code> is: <code>"PCard__0000_Front_(2).jpg"</code></p>

<p>The error I get is: </p>

<pre><code>/path/to/app/and/file/folder/PCard__0000_Front_&amp;#40;2&amp;#41;.jpg)
[function.file-get-contents]: failed to open stream: No such file or
directory
</code></pre>

<p>Now if I call the function with a string: <code>file_get_contents("/path/to/app/and/file/folder/PCard__0000_Front_(2).jpg")</code> it works well</p>

<p>Please some advise on what am I doing wrong, I would really like to understand why this happens.</p>

<p>Thanks!</p>

<p>P.S. I have seen some others say to use curl instead but I would really appreciate if someone could shed some light into why this is happening and how can I solve it using file_get_contents no matter how much better the other function could be.</p>
