Игорь_Vasinsky блин.... а я думаю тут......
$r = mysql_query("SELECT * FROM `FILMS` ORDER BY 'name' ASC");
$need = array();
while ($row = mysql_fetch_array ($r)){
$id = $row['id'];
global $id;
$nod = array(
'0' => $row['name'],
'1' => $row['origname'],
);
$nod = array_unique($nod);
$need = array_merge($nod, $need);
$need = array_unique($need);
$pets = $need;
}
$return = array();
$str = mb_strtolower(($_POST['pet']), 'UTF-8');
function str_srch($item, $key) {
global $return,$str,$id;
global $id;
if(mb_strtolower(substr($item,0,strlen($str)), 'UTF-8') == $str) $return[] = $item;
}
array_walk($pets,'str_srch');
if(count($return)>0)
{
echo '<ul><li style="text-align:center; cursor:text"></li>
<li class="li" style="cursor:pointer" > <a href="'.$id.'">'.implode('</a></li><li> <a href="'.$id.'">',$return).'</a></li></ul>';
}
else echo '<span></span>';
Цитата |
echo '<ul><li style="text-align:center; cursor:text"></li> <li class="li" style="cursor:pointer" > <a href="'.$id.'">'.implode('</a></li><li> <a href="'.$id.'">',$return).'</a></li></ul>'; |