-1
之後我怎麼能剎兩次迭代後foreach循環,這樣的事情:打破foreach循環兩次迭代
foreach($posttags as $tags){
$tag1 = $tags->slug;
} --- this is the first iteration, stored in the variable $tag1
foreach($posttags as $tags){
$tag2 = $tags->slug;
} ---- this is the second iteration, stored in the variable $tag2
brake; --- brake the foreach loop
任何想法?
難道你不能同時設置兩個? –
中斷可能不會制動代碼,但制動器肯定不會按預期中斷。 – 2011-11-09 02:09:59
*'foreach'之後的'break' *?它應該打破什麼?另外,在一個循環中,兩個*循環*不同於兩個*迭代*。 – deceze