PO::read_line( resource $f, string $action = 'read' ): bool


Parameters

$f resource Required
$action string Optional

Default: 'read'


Top ↑

Return

bool


Top ↑

Source

File: wp-includes/pomo/po.php. View all references

public 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          = ( "\r\n" === substr( $line, -2 ) ) ? rtrim( $line, "\r\n" ) . "\n" : $line;
	$last_line     = $line;
	$use_last_line = false;
	return $line;
}


Top ↑

User Contributed Notes

You must log in before being able to contribute a note or feedback.