title: I have a base64 encoded png, how do I write the image to a file in PHP?
body: <p>What's the proper way in PHP to create an image file (PNG), when I have the base64 encoding?</p>
  
  <p>I've been playing around with:</p>
  
  <pre>
  <code>
  file_put_contents('/tmp/'. $_REQUEST['id'].'.png', $_REQUEST['data']);
  </code>
  </pre>
  
  <p>do I need to decode? should I be using the gd library?</p>