我原來的字符串是沒有PHP
one,two,three,four,five,
我需要單獨的每個字爲紐帶
<a href="">one</a>, <a href="">two</a>, <a href="">three</a>, ...
我的代碼是
$plat = $row['reg'];
foreach ($plat as $key => $pv) {
$pl[] = implode(',', $pv);
}
for ($p = 1; $p = sizeof($pl); $i++) {
echo '<a href="#" rel="tag">' . $pl[i] . '</a>';
}
簡單使用'爆炸( 「」,$ STR)'與陣列逗號分割字符串並根據你的需要使用它 –
@SatishSharma不僅他需要把第二個interator放在第一個像在我的代碼。 – BaBL86