1 回答

TA貢獻(xiàn)1906條經(jīng)驗(yàn) 獲得超10個(gè)贊
您可以使用 .= 賦值運(yùn)算符將結(jié)果值相互連接
foreach ($closures as $closure) {
//stuff
for ( $i = 0; $i < $count; $i++){
$vcount = count( $locations[$i] );
// initiate the result
$result = "";
while ( $vcount < 2 ) {
// concatinate the value to $result
$result .= "The ".$venue[$i]." has been reserved for an <a href=".$eventURLs[$i].">event</a> today from ".$startTime[$i]." - ".$endTime[$i].".<br>";
//print_r($result); //looks good printed...
break;
}
while ($vcount > 1 ) {
// concatinate the value to $result again
$result .= "The ".$venue[$i]."s have been reserved for an <a href=".$eventURLs[$i].">event</a> today from ".$startTime[$i]." - ".$endTime[$i].".<br>";
//print_r($result); //looks good printed...
break;
}
}
return $result;
break;
}
- 1 回答
- 0 關(guān)注
- 181 瀏覽
添加回答
舉報(bào)