title: How to convert this associative array into this json output using json_encode()
body: <p>I have this php associative array. </p>
  
  <pre><code>array(
                  'Location_1' =&gt; 'Link_1',
                  'Location_2' =&gt; 'Link_2'
      )
  </code></pre>
  
  <p>I would like to convert it into a json output using json_encode() that looks like this;</p>
  
  <pre><code>[{"Location_name":"Location_1","Link_name":"Link_1"},{"Location_name":"Location_2","Link_name":"Link_2"}]
  </code></pre>
  
  <p>How can this be done? The challenging part to me seems like how to add the Location_name and Link_name in front. Thank you very much.</p>