私は以下の機能を持っています:
function getStoresDisplay($data, $page_number, $nb_display) {
$nb_stores = $data['nb_stores'];
$list = $data['list'];
$current_address = $data['address'];
if($current_address=='') $current_address_display = ' ';
else $current_address_display=$current_address;
$display .= '<ul data-role="listview" data-theme="d">';
$display .= '<li data-role="list-divider" data-theme="a">'.$current_address_display.'<span class="ui-li-count">'.$nb_stores.'</span></li>';
for($i=0; $i<count($list); $i++) {
$id = $list[$i]['id'];
$name = $list[$i]['name'];
$logo = $list[$i]['logo'];
$address = $list[$i]['address'];
$distance = $list[$i]['distance'];
$created = $list[$i]['created'];
$display .= '<li><a href="javascript:" class="displayStoreDetails" id="'.$id.'">';
if($logo!='') $display .= '<img src="'.$logo.'" style="margin-top:18px;">';
$display .= '<h3>'.$name;
$display .= '</h3>';
//if($current_address!='') $display .= '<span class="ui-li-count"><font color="red"><small>'.ceil($distance).' '.$GLOBALS['distance_unit'].'</small></font></span>';
$display .= '<p>'.$address.'</p>';
if($current_address!='') $display .= '<p><small>Dista da te: </small><font color="red"><small>'.ceil($distance).' '.$GLOBALS['distance_unit'].'</small></font></p>';
$display .= '</a></li>';
}
$display .= '</ul><br>';
$display .= '<div data-role="controlgroup" data-type="horizontal" data-theme="a" style="text-align:right;" >';
if($page_number>1) $display .= '<a href="javascript:" id="displayStoresListNextPreviousBtn" page_number="'.($page_number-1).'" data-role="button" data-icon="arrow-l" data-theme="d">Previous</a>';
$display .= '<a href="javascript:" data-role="button" data-theme="d"><span id="pageNumberReload">'.$page_number.'</span></a>';
if($nb_stores>($page_number*$nb_display)) $display .= '<a href="javascript:" id="displayStoresListNextPreviousBtn" page_number="'.($page_number+1).'" data-role="button" data-icon="arrow-r" data-theme="d">Next</a>';
$display .= '</div>';
return $display;
一意の名前()の結果のみを出力するようにしたい$name = $list[$i]['name'];
。異なるカテゴリに同じアイテムがあるので、同じ名前の重複アイテムを印刷しないようにしたいと思います。
これどうやってするの?