php do while 语句
Jun 08, 2016 pm 05:29 PMdo... while语句将始终执行的代码块一次,然后检查的条件,并重复循环,而条件是真实的。
语法
do
{
code to be executed;
}
while (condition);
例如
下面的例子定义了一个循环,开始与i = 1。然后它将增加1我和写一些输出。然后,条件是检查,循环将继续运行像我只要小于或等于5:
$i=1;
do
{
$i++;
echo "The number is " . $i . "
";
}
while ($i
?>
/* example 1 */
$i = 1;
while ($i
echo $i++; /* the printed value would be
$i before the increment
(post-increment) */
}
/* example 2 */
$i = 1;
while ($i
echo $i;
$i++;
endwhile;
?>
$q1 = 'some query on a set of tables';
$q2 = 'similar query on a another set of tables';
if ( ($r1=mysql_query($q1)) && ($r2=mysql_query($q2)) ) {
while (($row=mysql_fetch_assoc($r1))||($row=mysql_fetch_assoc($r2))) {
/* do something with $row coming from $r1 and $r2 */
}
}
?>

인기 기사

인기 기사

뜨거운 기사 태그

메모장++7.3.1
사용하기 쉬운 무료 코드 편집기

SublimeText3 중국어 버전
중국어 버전, 사용하기 매우 쉽습니다.

스튜디오 13.0.1 보내기
강력한 PHP 통합 개발 환경

드림위버 CS6
시각적 웹 개발 도구

SublimeText3 Mac 버전
신 수준의 코드 편집 소프트웨어(SublimeText3)

뜨거운 주제











Windows 11에서 창 테두리 설정을 조정하는 방법: 색상 및 크기 변경

Windows 11에서 제목 표시줄 색상을 변경하는 방법은 무엇입니까?

Windows 11에서 작업 표시줄 축소판 미리 보기를 활성화 또는 비활성화하는 방법
