PO::read_line()
最后更新于:2021-11-25 21:27:02
PO::read_line( resource$f, string$action=’read’)参数
- $f
-
(resource) (Required)
- $action
-
(string) (Optional)
Default value: ‘read’
响应
(bool)
源文件
文件: gc-includes/pomo/po.php
function read_line( $f, $action = 'read' ) {
static $last_line = '';
static $use_last_line = false;
if ( 'clear' === $action ) {
$last_line = '';
return true;
}
if ( 'put-back' === $action ) {
$use_last_line = true;
return true;
}
$line = $use_last_line ? $last_line : fgets( $f );
$line = ( "rn" === substr( $line, -2 ) ) ? rtrim( $line, "rn" ) . "n" : $line;
$last_line = $line;
$use_last_line = false;
return $line;
}