function text($a){

	$array = explode("\n", file_get_contents('dosya.txt'));
	$text = '';
	for ( $i=0; $i<$a; $i++ ) {
	
		$text .= $array[$a];

	}
	return $text;
	
}	
	
echo text(10);
böyle birşey olabilir. Test etmedim.