public static function appendDataToFile($filePath, $data, $newLine = false) {
        if ($newLine) {
            file_put_contents($filePath, $data . PHP_EOL, FILE_APPEND);
        } else {
            file_put_contents($filePath, $data, FILE_APPEND);
        }
    }
public static function appendDataToFile($filePath, $data, $newLine = false) {
        if ($newLine) {
            file_put_contents($filePath, $data . PHP_EOL, FILE_APPEND);
        } else {
            file_put_contents($filePath, $data, FILE_APPEND);
        }
    }
public static function appendDataToFile ( $ filePath , $ data , $ newLine = false ) { if ( $ newLine ) { file_put_contents ( $ filePath , $ data . PHP_EOL , FILE_APPEND ) ; } else { file_put_contents ( $ filePath , $ data , FILE_APPEND ) ; } }
Add data to the end of a file.

@param $filePath string
@param $data string
@param $newLine boolean
Add data to the end of a file .