title: Parse large JSON file
body: <p>I'm working on a cron script that hits an API, receives JSON file (a large array of objects) and stores it locally.  Once that is complete another script needs to parse the downloaded JSON file and insert each object into a MySQL database.  </p>
  
  <p>I'm currently using a <code>file_get_contents()</code> along with <code>json_decode()</code>.  This will attempt to read the whole file into memory before trying to process it.  This would be fine except for the fact that my JSON files will usually range from 250MB-1GB+.  I know I can increase my PHP memory limit but that doesn't seem to be the greatest answer in my mind.  I'm aware that I can run <code>fopen()</code> and <code>fgets()</code> to read the file in line by line, but I need to read the file in by each json object.</p>
  
  <p>Is there a way to read in the file per object, or is there another similar approach?</p>