Using PDO (guide), for example, you could execute a query with an array, giving you a few options.
One such option would be to execute numerous queries with each sub-array, such as:
foreach ($arrays as $array) {
$query = $database->prepare('SELECT name, color, calories FROM fruit WHERE calories < ? AND color = ?');
$query->execute($array);
}
Another option would be to flatten out your array and do a multi line query like so:
$flat_array = []; //The array that will contain all the values of the main array of data
$query = 'insert into fruit (name, color, calories) values '; //Build the base query
foreach ($arrays as $array) {
$query .= '(?, ?, ?),'; //Add in binding points to the query
foreach ($array as $value) $flat_array[] = $value; //Add each value of each sub-array to to the top level of the new array
}
$query = $database->prepare(substr($query, 0, -1)); //Prepare the query, after removing the last comma
$query->execute($flat_array); //Execute the query with the new, flat array of values
You would then be able to pull out the data into an associative array later on with that same guide.