I went back and looked, and if you want to put the results in a variable, if thats what you mean, alls you do is change that last line..
<?
$limite = 3;
$links = "links.txt";
if ($numero != 0) {
$linhas = file($links);
$linhas = preg_replace("/#/", "\n", $linhas);
for($i=0; $i < $limite; $i++) {
$joinedresult .= $linhas[$i];
}
}
?>