title: PHP Image from URL
body: <p>I have the following url which returns an image in the body, How would I assign that image to a variable so that I could save it or use it within my code?</p>
  
  <blockquote>
    <p><a href="https://media.licdn.com/dms/image/C4E03AQGOM3p0fHNkwQ/profile-displayphoto-shrink_100_100/0?e=1556755200&amp;v=beta&amp;t=qeQFKYXpev2ZW3hmP1ODDPd3DYPWvl-GaUnPSZG-aQA" rel="nofollow noreferrer">https://media.licdn.com/dms/image/C4E03AQGOM3p0fHNkwQ/profile-displayphoto-shrink_100_100/0?e=1556755200&amp;v=beta&amp;t=qeQFKYXpev2ZW3hmP1ODDPd3DYPWvl-GaUnPSZG-aQA</a></p>
  </blockquote>
  
  <p>The following code returns noting:</p>
  
  <pre><code>&lt;?php
       $url = "https://media.licdn.com/dms/image/C4E03AQGOM3p0fHNkwQ/profile-displayphoto-shrink_100_100/0?e=1556755200&amp;v=beta&amp;t=qeQFKYXpev2ZW3hmP1ODDPd3DYPWvl-GaUnPSZG-aQA";
       $image = file_get_contents($url);
       echo $image;
  ?&gt;
  </code></pre>