вот сам скрипт
<?php
include("auto_data.php");
$k=array_keys($Sitys_auto);
$slush=0;
$outStr="<table width='100%' border='0' >
<tr>
<td style='border-width: 0px;border:none none; text-align:left;'>";
if ($_GET['b']=='00'){
$outStr.="<h2>".mb_substr($k[0],0,1,"UTF-8")."</h2><br>";
$outStr.="<a href=#>".$k[0]."</a><br>";
for ($i=1; $i< count($k);$i++){
if(strcasecmp (mb_substr($k[$i],0,1,"UTF-8"), mb_substr($k[$i-1],0,1,"UTF-8"))!=0){
if($i>count($k)/2 && $slush==0){
$outStr.="</td><td style='border-width: 0px;border:none none; text-align:left;'>";
$slush=1;
}
$outStr.="<h2>".mb_substr($k[$i],0,1,"UTF-8")."</h2><br>";
}
$outStr.="<a href=#>".$k[$i]."</a><br>";
}
}
else{
$outStr.="<h2>".$_GET['b']."</h2><br>";
for ($i=0; $i< count($k);$i++){
if(strcasecmp (mb_substr($k[$i],0,1,"UTF-8"), $_GET['b'])==0){
$outStr.="<a href=#>".$k[$i]."</a><br>";
}
}
}
$outStr.="</td> </tr> </table>";
echo(json_encode($outStr));
?>