title: How to get updated score without page refresh in PHP using API
body: <p>I have PHP code that updates score using API accompanied with a key by <code>file_get_content</code> PHP function.</p>
  
  <p>I am getting the score, but every time I have to reload the page to get the updated score.</p>
  
  <p>Can anyone tell me how to refresh the score without page reload? I know PHP server-side script language so definitely I have to refresh my own.</p>
  
  <p>Is there any way to implement node.js here?</p>
  
  <p>PHP code:</p>
  
  <pre><code>&lt;?php
  $var='xyzxyzxyz'; //My api key
  
      $cricketMatchesTxt = file_get_contents('http://cricapi.com/api/cricket/?apikey='.$var.' '); // change with your API key
      $cricketMatches = json_decode($cricketMatchesTxt);
  
      foreach($cricketMatches-&gt;data as $item) {
  ?&gt;
      &lt;h4&gt;&lt;?php echo($item-&gt;title); ?&gt;&lt;/h4&gt;
  &lt;?php } ?&gt;
  </code></pre>