title: How to include a php variable in json and pass to ajax
body: <p><em>My Code</em></p>
  
  <pre><code>var json = xmlhttp.responseText; //ajax response from my php file
  obj = JSON.parse(json);
  alert(obj.result);
  </code></pre>
  
  <p><em>And in my php code</em></p>
  
  <pre><code> $result = 'Hello';
  
   echo '{
          "result":"$result",
          "count":3
         }';
  </code></pre>
  
  <p>The problem is: when I alert <code>obj.result</code>, it shows <code>"$result"</code>, instead of showing <code>Hello</code>.
  How can I solve this?</p>