假設我有這樣的事情:PHP:在的forEach,當達到停止執行的條件,但後來繼續
$count = 0;
foreach($CourseDetails as $course_line) {
print "<tr><td>{$course_line['class_code']}</td>
<td>{$course_line['class_name']}</td>
<td>{$course_line['class_unit']}</td>
<td>{$course_line['class_description']}</td>
<td>{$course_line['class_instructors']}</td>";
$count = $count + 1
if ($count = 10);
$count = 0;
// code that stops script and makes a "Continue?" button pop up on the webpage under the already outputed details
// if the client presses the "Continue?" button, allow the script to continue (jump back into the foreach loop)
}
我試圖找到一種方法來阻止腳本,然後讓一個按鈕說「繼續?」。如果客戶端按下按鈕,我希望腳本繼續停下來。 PHP是否有任何允許這樣的功能?
數據是否來自數據庫?如果我理解正確,你正試圖實現某種'分頁'功能 – thaJeztah 2013-03-26 21:26:08