title: php codeigniter file_get_contents
body: <p>I'm currently working on a project that need <code>file_get_contents</code> function.
  the problem I have right now is: how do I retrieve back the result i got from the <code>file_get_contents</code> url?</p>
  
  <h2>the code</h2>
  
  <p>controller </p>
  
  <pre><code>public function send()
  {
  
      $pokemon    = $this-&gt;input-&gt;post('username');
      $password   = $this-&gt;input-&gt;post('password');
      $siteaddressAPI = "http://host/wmc/receive/".$pokemon."/".$password."";
      $homepage = json_decode(file_get_contents($siteaddressAPI));
      if (! $homepage) {
          echo "failed";
      } else {
          echo $homepage;
      }
  }
  </code></pre>
  
  <p>this is the code from file_get_contents controller</p>
  
  <pre><code>function receive($pokemon,$password)
  {
      $this-&gt;load-&gt;model('m_wmc');
  
      //echo $pokemon .' - '. $password;
      $data= $this-&gt;m_wmc-&gt;get_member_data($pokemon,$password);
      $this-&gt;load-&gt;view('vw_wmc_bio',$data);
  
  }
  </code></pre>
  
  <p>The question is how do I return the result of the receive function from the host to display the whole package including the view ?</p>
  
  <p>I managed to display the result from the query.
  Using this approach.</p>
  
  <pre><code>$this-&gt;load-&gt;model('m_wmc');
  
  //echo $pokemon .' - '. $password;
  $data= $this-&gt;m_wmc-&gt;get_member_data($pokemon,$password);
  foreach ($data-&gt;result() as $key) {
      echo 'CUSTOMERID'   . ':' . $key-&gt;CUSTOMERID;
      echo 'CUSTOMER'     . ':' . $key-&gt;CUSTOMER;
      echo 'EMAIL'        . ':' . $key-&gt;EMAIL;
      echo 'ADDRESS'      . ':' . $key-&gt;ADDRESS;
      echo 'TELEPHONE'    . ':' . $key-&gt;TELEPHONE;
  }
  </code></pre>