Я пытаюсь выяснить, как я могу добавить счетчик, чтобы каждый результат мог отображаться как -b-c и т. Д., Но я не знаю, что мне нужно сделать, вы можете мне помочь.Чтобы было понятнее, я пытаюсь добавить то, что есть у Google Maps при поиске, и он показывает маркер и a, b, c по результатам.
$xmlString = file_get_contents($mapURL);
$xmlString = str_replace('georss:point','point',$xmlString);
$xml = new SimpleXMLElement($xmlString);
$items = $xml->xpath('channel/item');
$closeItems = array();
foreach($items as $item)
{
$latlng = explode(' ',trim($item->point));
//calculate distance
$dist = calc_distance(array('lat'=>$zlat,'long'=>$zlng),array('lat'=>$latlng[0],'long'=>$latlng[1]));
if($dist<={segment_4})$closeItems[] = $item;
}
?>
<div style="float:left; width:100%;margin:10px 0px;"><h1 style="font-size:16px; font-weight:bold; border-bottom:1px solid #333;">Servicer Results (within {segment_4} miles) of Your selected area</h1></div>
// код вопроса
<?php foreach($closeItems as $item ):?>
<div style="float:left; width:275px;height:auto;margin:20px 5px;margin-left:40px; font-family: Arial,Helvetica;font-size:12px">
<h2 style="font-size:16px;color: #499AAE; ;"><img src="http://winstonind.com/images/mapicon.png" alt="map icon" /> <strong><?=$item->title?></strong></h2>
</div>
Новый код работает, но не как буквы
<div style="float:left; width:100%;margin:10px 0px;"><h1 style="font-size:16px; font-weight:bold; border-bottom:1px solid #333;">Servicer Results (within {segment_4} miles)</h1></div>
<?php foreach($closeItems as $index=>$item ):?>
<div style="float:left; width:275px;height:auto;margin:20px 5px;margin-left:40px; font-family: Arial,Helvetica;font-size:12px">
<h2 style="font-size:16px;color: #499AAE; ;"><img src="http://winstonind.com/images/mapicon.png" alt="map icon" /> <strong><? echo $index; ?><?=$item->title?></strong></h2>
</div
>