I am trying to fetch values from php file
api.php
      <?php
      // want to fetch this value 
      $a = 'come!! fetch this value';
      ?>
my javascript page has code like this.(this code is not on page api.php)
            fetch('http://localhost/react_task/react-webpack-boilerplate/php/api.php', {
        method: 'get',
        // may be some code of fetching comes here
    }).then(function(response) {
            if (response.status >= 200 && response.status < 300) {
                return response.text()
            }
            throw new Error(response.statusText)
        })
        .then(function(response) {
            console.log(response);
        })
can you please guide me how to fetch value of variable from php file by using fetch.
 
     
     
     
    