title: PHP get results from URL
body: <p>stupid question I think.</p>
  
  <p>I have an API that i want to access. if I simply put the url in my browser it returns all the results correctly.</p>
  
  <pre><code>https://api.mydomain.com/v1/name?user=user1&amp;pass=1234
  </code></pre>
  
  <p>in my browser this returns array information:</p>
  
  <pre><code>{"firstname":"John","Surname":"Smith"}    
  </code></pre>
  
  <p>I want to be able to use PHP to simply assign the results of the URL page to a variable:</p>
  
  <pre><code>$url="https://api.mydomain.com/v1/name?user=user1&amp;pass=1234";
  $result=parse($url);
  print_r($result);
  </code></pre>
  
  <p>This obviously doesnt work but just looking for the correct syntax. done some research but not getting any luck. should be so simple but is not.</p>
  
  <p>advice appreciated as always.
  Thanks</p>