title: PHP convert Array to JSON issue?
body: <p>When I <code>print_r($arr)</code> something like <code>Array ( [0] =&gt; Hello [1] =&gt; world);</code> is output.</p>
  
  <p>I tried to convert in <strong>JSON</strong> string using below code.</p>
  
  <pre><code>$result['result'] = $arr;
  json_encode($result);
  </code></pre>
  
  <p>This results in this JSON string:</p>
  
  <pre><code>{"result" : { "0" : "hello" , "1" : "world"}}
  </code></pre>
  
  <p>The expected result would be this:</p>
  
  <pre><code>{ "result" : ["hello" , "world"]}
  </code></pre>
  
  <p>What can I do to get the desired output?</p>