Podepnę się pod ten post, ponieważ mam pytanie z tego tematu.
Jak zmienić poniższy kod, tak by wyciągał drugą, a nie pierwszą (zerową) linę w pliku, a najlepiej jak za jednym zamachem wyciągać dwie lub trzy linie (chodzi o najnowsze komentarze, bo pokazuje aktualnie tylko jeden, a chciałabym 2 lub 3).
Z góry bardzo dziękuję za pomoc

<?php
function newestcomment(){
include("settings.php");
$commentfilearray = file($commentfile); unset($commentfilearray[0
]);
foreach($commentfilearray as $comment){
$break = "|";
list
($name_comm, $comment_comm, $date_comm, $id_comm, $status_comm)=explode($break,$comment);
if(trim($status_comm) == "1"){ }
}
if(count($newarray) != 0
){
$blogfilearray = file($datafile); unset($blogfilearray[0
]);
$break = "|";
list
($name_comm, $comment_comm, $date_comm, $id_comm, $status_comm)=explode($break,$newarray[0
]);
foreach($blogfilearray as $thisline){
list
($title, $post, $date, $id, $image, $username_blog)=explode("|",$thisline);
if($id == $id_comm){
include("./accounts/{$name_comm}.php");
$name_comm = "<a href=\"view_member.php?username=$name_comm\">$name_comm</a>";
}
"/:)/",
"/:(/",
"/:o/",
"/:P/",
"/:|/",
"/:D/",
"/:banana:/");
"<img src=\"emoticons/smile.gif\" border=\"0\">",
"<img src=\"emoticons/sad.gif\" border=\"0\">",
"<img src=\"emoticons/oh.gif\" border=\"0\">",
"<img src=\"emoticons/tongue.gif\" border=\"0\">",
"<img src=\"emoticons/dry.gif\" border=\"0\">",
"<img src=\"emoticons/biggrin.gif\" border=\"0\">",
"<img src=\"emoticons/banana.gif\" border=\"0\">");
$comment_comm = preg_replace($patterns,$replacements, $comment_comm); echo "<b>$name_comm:</b> $comment_comm<br />in <a href=\"view_post.php?id=$id\">$title</a><br><br>";
}
}
} else {
}
}
?>