title: PHP - how to get specific value of curl response
body: <p>I am using curl method to get response from an API. It did return a xml response. </p>
  
  <p>The response return a set of strings which I could not get the exact value that I want. </p>
  
  <p>These are my codes:</p>
  
  <pre><code>$url = 'someurlwithGETparameter';
  
  $ch = curl_init();
  
  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
  curl_setopt($ch, CURLOPT_URL, $url);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  $data = curl_exec($ch);
  
  curl_close($ch);
  </code></pre>
  
  <p>for example: </p>
  
  <pre><code>&lt; foods &gt;
       &lt; chinese &gt; Shark Fin &lt;/ chinese&gt;
       &lt; japanese &gt; Sushi &lt;/ japanese&gt;
  &lt; /foods &gt;
  </code></pre>
  
  <p>I would like to get Chinese food "Shark Fin" and put it in a variable.</p>
  
  <pre><code>$chineseFood = $somethinglike['chinese'];
  </code></pre>
  
  <p>So when I echo $chineseFood, I will get "Shark Fin".</p>
  
  <p>Please help. Just started CURL today and I am not really familiar with CURL</p>
  
  <p>Thanks a lot =)</p>