title: Parse a json search to show up in respective divs
body: <p>I have a json output as</p>
  
  <pre><code>{"cities":[{"id":"1995","name":"Banahatti"},{"id":"5074","name":"Kolhapur(Maharashtra)"},{"id":"2356","name":"Sangola"},{"id":"906","name":"Shahada"},{"id":"536","name":"Puttur"}
  </code></pre>
  
  <p>This shows a list of sources for a bus ticketing application.The api returns me a response as json as shown above.</p>
  
  <p>Now I wanted to show this json by extracting the ids and names and show this as a drop down menu.</p>
  
  <pre><code>&lt;select&gt;&lt;option value="1995"&gt;Banahatti&lt;/option&gt;
  &lt;option value="2356"&gt;Sangola&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>so</p>
  
  <pre><code>&lt;select&gt;&lt;?php echo "&lt;option value=".$id."&gt;".$name."&lt;/option&gt;"?&gt;&lt;/select&gt;
  </code></pre>
  
  <p>I wanted to loop through all ids and names and echo it as shown above.</p>