title: Get attribute with file_get_contents PHP
body: <p>I have a sql query that I store in a variable and I displayed. I get the contents of this with file_get_contents from another file, I would like to recover some of this code (which is html) in order to make link. More precisely retrieve the id.
  My api.php</p>
  
  <pre><code>$base = mysql_connect ('localhost','root','');
  mysql_select_db('administrations', $base);
  
  if(isset($_GET['cp']))
  {
      $sql = 'SELECT NOM_organisme, ID_organisme
              FROM organismes
              WHERE code_postal LIKE "%'.$_GET['cp'].'%"
              ORDER BY NOM_organisme;';
  
      $req = mysql_query($sql) or die('SQL Error !&lt;br&gt;'.$sql.'&lt;br /&gt;'.mysql_error());
  }
  
  while ($data = mysql_fetch_array($req))
  {
      echo '&lt;p id="'.$data['ID_organisme'].'"'.
           $data['NOM_organisme'].'&lt;/br&gt;'.
           $data['ID_organisme'].'&lt;/p&gt;&lt;/br&gt;';
  }
  </code></pre>
  
  <p>I want to get the <code>id="I WANT THIS"</code>.</p>
  
  <p>And my index.php (part of my code that retrieves the contents).</p>
  
  <pre><code>if(isset($_POST['cp']))
  {
      $api = "http://mywebsite.fr/api.php?cp=".$_POST['cp'];
      $var = file_get_contents($api);
      echo $var;
  }
  </code></pre>
  
  <p>How can I get the <code>id=""</code> in my index.php ?</p>