public static function writeFile($strFilePath, $strContents)
    {
        $fileHandle = fopen($strFilePath, "w");
        if (!$fileHandle) {
            throw new \Exception("Cannot open file for writing: " . $strFilePath);
        }

        if (fwrite($fileHandle, $strContents, strlen($strContents)) === false) {
            throw new \Exception("Unable to write file: " . $strFilePath);
        }
        fclose($fileHandle);
    }
public static function writeFile($strFilePath, $strContents)
    {
        $fileHandle = fopen($strFilePath, "w");
        if (!$fileHandle) {
            throw new \Exception("Cannot open file for writing: " . $strFilePath);
        }

        if (fwrite($fileHandle, $strContents, strlen($strContents)) === false) {
            throw new \Exception("Unable to write file: " . $strFilePath);
        }
        fclose($fileHandle);
    }
public static function writeFile ( $ strFilePath , $ strContents ) { $ fileHandle = fopen ( $ strFilePath , "w" ) ; if ( ! $ fileHandle ) { throw new \ Exception ( "Cannot open file for writing: " . $ strFilePath ) ; } if ( fwrite ( $ fileHandle , $ strContents , strlen ( $ strContents ) ) === false ) { throw new \ Exception ( "Unable to write file: " . $ strFilePath ) ; } fclose ( $ fileHandle ) ; }
Write data into file

@param string $strFilePath Path of the file into which to write
@param string $strContents The contents that should be written into the file

@throws \Exception
Write data into file