title: PHP Data- URI to Image
body: <p>I have Data URI(image) and  I am trying to save using php, my code is</p>
  
  <pre><code>$filename = 'test.png';
  $fp = fopen("user_images/".$filename,"w");
  fwrite($fp, base64_decode($_POST['strDataURI']));
  fclose($fp);
  </code></pre>
  
  <p>It gives me corrupted image always, But i am getting right image when i use in <strong>Javascript</strong></p>
  
  <pre><code>document.write('&lt;img src="'+strDataURI+'"/&gt;');
  </code></pre>