title: Echo PHP code into javascript innerHTML
body: <p>I have a PHP function that adds <strong>+1</strong> every time it runs.</p>
  
  <pre><code>function count_likes(){
    $collect=file_get_contents('like_counter.txt')+1;
    $count=file_put_contents("like_counter.txt", $collect);
    echo $collect;
  </code></pre>
  
  <hr>
  
  <p>I have a javascript that should run the PHP function mentioned earlier.
  That is when the user clicks on the button every time, I call for the PHP function inside the <code>innerHTML</code> as a string.Unfortunately id doesn't change anything in the document.</p>
  
  <pre><code>var like=document.getElementById("like__image");
  addEventListener("click",function(event){
      event.preventDefault();
      var likeBox=document.getElementById("like__box");
      likeBox.innerHTML="&lt;?php count_likes()  ?&gt;";
  });
  </code></pre>
  
  <p>How can I call my PHP function inside my Javascript ? </p>