public static function loadCsvToArray($field, $firstRowLabels = true)
    {
        $result = false;
        if (!empty($_FILES[$field]['tmp_name'])) {
            /* open the file for reading */
            $csv = fopen($_FILES[$field]['tmp_name'], 'r');
            $result = array();

            /* treat the first row as column labels */
            if ($firstRowLabels) {
                $fields = fgetcsv($csv);
            }

            /* walk through the file, storing each row in the array */
            while ($csvRow = fgetcsv($csv)) {
                $row = array();

                /* if we have column labels, use them */
                if ($firstRowLabels) {
                    foreach ($fields as $i => $field) {
                        if (isset($csvRow[$i])) {
                            $row[$field] = $csvRow[$i];
                        }
                    }
                } else {
                    $row = $csvRow;
                }

                /* append the row to the array */
                $result[] = $row;
            }
            fclose($csv);
        }
        return $result;
    }