export an image in base64
<p>I want to create an image in php having the data encoded in base64
Use the code: <code>file_put_contents('export/MyFile.png', base64_decode($img));</code>
I read on the browser, but 7483 should be a larger number.
if I open the image was created only half (the other half is transparent)
if the variable $img contains a short string, it works.
if it contains a string too long the image will be created only partially.
why?</p>

<p>PS: if I use</p>

<pre><code>$img = base64_decode($img);
$fp = fopen("export/MyFile.png", "w");
fwrite($fp, $img);
fclose($fp); 
</code></pre>

<p>I have the exact same problems</p>

<p>thanks</p>
