title: Saving google places api photos to my server
body: <p>i need to save the images returned from the google places API to my server. 
  I've tried :</p>
  
  <pre><code>$url= 'https://maps.googleapis.com/maps/api/place/photo?key=API_KEY_HERE&amp;photo_reference=CoQBcwAAAAtXfnhO3WCagOlY4p4Px7N8Pcks_N-cLbMQzruT-AdWRZoyJgABVUUcuZ_4bbcUdReloBl2zGd80W4E4w-N_kyab4xz4S3ZZIRVECCJP1u7JsXOfxEsx4XQbL-HeMBRKzNul0XSdy-Dv4495i_8-SqYqTBZMaLvn1YLaVM3aAzOEhBgLV4lpKeM39L6gb9wBbU6GhSmCkYp8djpm9_iaqkS93z4ekLnNg&amp;maxheight=200'
  
  $target = md5($array['result']['photos'][0]['photo_reference']);
  $newname = 'img/googlephotos/newimage'.$target;
  file_put_contents($newname,file_get_contents($url));
  </code></pre>
  
  <p>But it's not working - when it's saving it saves an empty file and not the image - I think it is missing the file extension but I'm not sure how to get it. does anyone know of any ways to save google places photo?</p>
  
  <p>I'm using PHP to write my code.</p>
  
  <p>Any help would be great</p>