title: How can I fix iOS image orientation issues when uploading an image with php and after is has been uploaded
body: <p>So, I am trying to find out how to fix images orientation when uploading them and after they have been uploaded. I hardly know how to get their exif information by doing this. </p>
  
  <pre><code>$image = img_dir .$ref['filename'];
  $exif = exif_read_data($image, 0, true);
  </code></pre>
  
  <p>I use this line below to show the image orientation in a span. </p>
  
  <pre><code>&lt;?= "" . $exif['IFD0']['Orientation'] . "\n"?&gt;
  </code></pre>
  
  <p>Now, I am trying to use the image orientation to flip the image according to the orientation. For example: I have an image of a flower, and it has an orientation of "6", so I would like to get the image to rotate according to its number and then display it. </p>