title: Get the path of the downloads folder in PHP?
body: <p>I'm building a script that will save an image from the web to the user's computer. This is what I've learned, so far: </p>
  
  <pre><code>$url = 'http://example.com/my-image.jpg';
  $img = '/my/folder/my-image.jpg';
  file_put_contents($img, file_get_contents($url));
  </code></pre>
  
  <p>Is this the right way to do this? If so, how would I get the path to, say, the downloads folder, in the user's machine? </p>