title: Decode JSON array in php
body: <p><br/>
  I have this JSON Array in PHP which I receive from an Android request and I want to decode it so that I can get every value of each object in a loop and send them to a mysql database.</p>
  
  <p>So in the example beneath, there's a class with two objects including properties FirstName and LastName. I would like to pars this json so that I can use them in a PDO function which inserts these rows in a mysql database. </p>
  
  <pre><code>[
  { "firstName":"John" , "lastName":"Doe" }, 
  { "firstName":"Anna" , "lastName":"Smith" }, 
  { "firstName":"Peter" , "lastName":"Jones" }
  ]
  </code></pre>
  
  <p>How do I accomplish this. After a lot of trial and error it still won't work.
  Thanks in advance! </p>
  
  <p>Edit:
  json_decode worked after all. JSON syntax issue was the problem.</p>