title: Last.FM API parse with PHP
body: <p>I'm new to this so bear with my noobish question.</p>
  
  <p>Basically I want a user to enter a search phrase into a web-form and for the query to be passed to the lastFM API and return top artists using that phrase based on their "gettopartists" API node. Here's the code I have...</p>
  
  <pre><code>function last($q) {
      $target_url='http://ws.audioscrobbler.com/2.0/format=json&amp;method=tag.gettopartists&amp;api_key=....&amp;tag=' . $q . '';
      $ch = curl_init();
      curl_setopt($ch, CURLOPT_URL,$target_url);
      curl_setopt($ch, CURLOPT_RETURNTRANSFER,true);
  
      $return = curl_exec($ch);
  }
  </code></pre>
  
  <p>Obviously within that I get a valid return by printing "echo $return;" but I've no idea how to parse it correctly. No matter how many foreach arguments I put in I cannot avoid an error or no output at all...</p>
  
  <p>Thanks folks...</p>