public static function putContents($filename, array $data)
    {
        $csv = new static();

        foreach ($data as $row) {
            $csv->addRow($row);
        }

        $csv->write($filename);
    }
public static function putContents($filename, array $data)
    {
        $csv = new static();

        foreach ($data as $row) {
            $csv->addRow($row);
        }

        $csv->write($filename);
    }
public static function putContents ( $ filename , array $ data ) { $ csv = new static ( ) ; foreach ( $ data as $ row ) { $ csv -> addRow ( $ row ) ; } $ csv -> write ( $ filename ) ; }
Write a csv file, and throw a RuntimeException if it cannot be done.

@param string $filename The path to the file
@param array $data The data to write to the file

@return void
Write a csv file and throw a RuntimeException if it cannot be done .