PO::export_to_file()
最后更新于:2021-11-25 21:20:18
PO::export_to_file( string$filename, bool$include_headers=true)Same as {@link export}, but writes the result to a file
参数
- $filename
-
(string) (Required) Where to write the PO string.
- $include_headers
-
(bool) (Optional) Whether to include the headers in the export.
Default value: true
响应
(bool) true on success, false on error
源文件
文件: gc-includes/pomo/po.php
function export_to_file( $filename, $include_headers = true ) {
$fh = fopen( $filename, 'w' );
if ( false === $fh ) {
return false;
}
$export = $this->export( $include_headers );
$res = fwrite( $fh, $export );
if ( false === $res ) {
return false;
}
return fclose( $fh );
}