通过php创建列表组(boostrap)(在vcard文件中计数联系人)


Create list-group(boostrap) by php (Count contact in vcard file)

示例:如果我的Vcard有一个10触点。显示10个列表组。

我尝试循环:for($i=0; $i<$vcard; $i++)

在html:<a href="" class="list-group-item"> </a>中在php中:我不知道如何创建

我现在不知道该怎么办。你能帮我吗?

在html中在php中,我不知道如何创建

假设$vcard是一个数组,则可以执行

foreach($vcard as $contact) {
  // do something with the data of $contact
}

每个的PHP手册

但你也可以留在你的for-循环

for($i=0; $i < count($vcard); $i++) {
  // do something with data of $vcard[$i]
}