title: Call PHP from Javascript on the same page?
body: <p>I have been researching into using PHP and Javascript to communicate with each other on the same page.</p>
  
  <p>Firstly I have a php script at the top with a function to retrieve a audio  from an AWS Ivona media stream.</p>
  
  <pre><code>&lt;?php
      function createAndPlay($text){
          // request service get response save to `$data`
          // I want this to then play the sound
      }
  ?&gt;
  
  &lt;script&gt;
  // when button clicked createAndPlay("Text to Speak")
  &lt;script&gt;
  </code></pre>
  
  <p>I would like this to be done on the same page WITHOUT starting when the body of the document is first loaded.</p>