foreach ($data as $comments) {
if ($comments['from_id'] > 0) {
$ids[] = $comments['from_id'];
$text[] = $comments['text'];
$date[] = $comments['date'];
}
}
$ids = array_values (array_unique ($ids) ); // удаляем повторы и восстанавливаем порядок индексов
foreach ($data as $comments) {
if ($comments['from_id'] > 0 && ! isset($ids[$comments['from_id']])) {
$ids[$comments['from_id']] = $comments['from_id'];
$text[$comments['from_id']] = $comments['text'];
$date[$comments['from_id']] = $comments['date'];
}
}