title: How to convert byte array to image and save it in folder using php ?
body: <p>I'm using below code </p>
  
  <p>Here $data is a byte array.</p>
  
  <pre><code>$decoded_data = base64_decode($data);
  $im = imagecreatefromstring($decoded_data);
  
  if ($im !== false) {
     header('Content-Type: image/png');
     $image_nam = "png_".time().".png";
      imagepng($im, $image_nam);
      imagedestroy($im);
  }
  </code></pre>
  
  <p>But I don't get the exact output</p>