Вернуть массив без повторяющихся элементов без array_unique()
<?php
$row = array(‘1’, ‘1’, ‘1’, ‘2’, ‘2’, ‘3’, ‘3’, ‘4’, ‘4’, ‘5’, ‘5’);
function a_unique($row) {
$un = array();
foreach ($row as $k1=>$r) {
$accept = true;
foreach ($un as $k2=>$t) {
if ($r == $t) $accept = false;
}
if ($accept == true) $un[] = $r;
}
return $un;
}
$row = a_unique($row);
foreach ($row as $k=>$num) {
echo $num;
}