push($separated); } /** * The first pass through the collection of data is to get all of the ore data * and store it in the database. From the database moon ore, we will create a list * of moons and store those in the database. After the list of moons are created in the * database, the function will then update the value of all the moons. */ //Start working our way through all of the moons //and saving the data to the database foreach($moons as $moon) { //If the first array is null then we are dealing with an ore if($moon[0] == null) { //Save a new entry into the database $ore = new AllianceMoonOre; $ore->moon_id = $moon[6]; $ore->moon_name = null; $ore->ore_type_id = $moon[3]; $ore->ore_name = $moon[1]; $ore->quantity = $moon[2]; $ore->solar_system_id = $moon[4]; $ore->planet_id = $moon[5]; $ore->save(); } } } }