If statement , For และ While loop statement....?

หมวดสำหรับแบ่งบันความ รู้ต่างๆ จะมีหมวดย่อยๆ ในหมวดนี้ เช่น php, SQL, XML, CSS

Moderator: mindphp, ผู้ดูแลกระดาน

Patcharanan.0399
PHP Hero Member
PHP Hero Member
โพสต์: 114
ลงทะเบียนเมื่อ: 09/04/2018 10:04 am

If statement , For และ While loop statement....?

โพสต์ที่ยังไม่ได้อ่าน โดย Patcharanan.0399 »

If statement ควบคุมการทำงานโดยใช้การแบ่งบล๊อคและการย่อหน้าแทนการใช้เครื่องหมาย {...}
[attachment=0]รูปแบบการเขียน if.PNG[/attachment] [attachment=13]If statement.PNG[/attachment] [attachment=4]ผลลัพธ์ If statement.PNG[/attachment]

For Loop statement คือการทำงานซ้ำจนกว่าจะพบว่าเป็นเท็จ โดยกำหนดช่วงการทำงานให้ใช้งานคู่กับ ' in '
[attachment=1]รูปแบบการเขียน for.PNG[/attachment] [attachment=14]for statement.PNG[/attachment] [attachment=5]ผลลัพธ์ for statement.PNG[/attachment]
8O Loop Control Statement ทำหน้าที่เปลี่ยนลำดับการทำงาน ได้แก่ Pass , Break , Continue
[attachment=11]pass,break,continue loop.PNG[/attachment] [attachment=3]ผลลัพธ์ pass loop.PNG[/attachment] [attachment=8]ผลลัพธ์ Break loop.PNG[/attachment] [attachment=6]ผลลัพธ์ Continue loop.PNG[/attachment]

While Loop statement คือการทำงานซ้ำโดยไม่ทราบจำนวนรอบที่แน่นอนเหมือนกับ For Loop และจะทำงานจนกว่าเงื่อนไขจะเป็นเท็จ
[attachment=10]while statement.PNG[/attachment] [attachment=2]ผลลัพธ์ while statement.PNG[/attachment]
8O Loop Control Statement จะทำหน้าที่เช่นเดียวกับ Loop Control Statement ใน For Loop
[attachment=12]pass,break,continue loop 1.PNG[/attachment] [attachment=9]ผลลัพธ์ Break loop 1.PNG[/attachment] [attachment=7]ผลลัพธ์ Continue loop 1.PNG[/attachment]




แนบไฟล์
for statement.PNG
for statement.PNG (3.01 KiB) Viewed 3216 times
If statement.PNG
If statement.PNG (9.02 KiB) Viewed 3216 times
pass,break,continue loop 1.PNG
pass,break,continue loop 1.PNG (12.26 KiB) Viewed 3216 times
pass,break,continue loop.PNG
pass,break,continue loop.PNG (10.45 KiB) Viewed 3216 times
while statement.PNG
while statement.PNG (3.08 KiB) Viewed 3216 times
ผลลัพธ์ Break loop 1.PNG
ผลลัพธ์ Break loop 1.PNG (1.98 KiB) Viewed 3216 times
ผลลัพธ์ Break loop.PNG
ผลลัพธ์ Break loop.PNG (2.04 KiB) Viewed 3216 times
ผลลัพธ์ Continue loop 1.PNG
ผลลัพธ์ Continue loop 1.PNG (3.18 KiB) Viewed 3216 times
ผลลัพธ์ Continue loop.PNG
ผลลัพธ์ Continue loop.PNG (2.74 KiB) Viewed 3216 times
ผลลัพธ์ for statement.PNG
ผลลัพธ์ for statement.PNG (1.65 KiB) Viewed 3216 times
ผลลัพธ์ If statement.PNG
ผลลัพธ์ If statement.PNG (1.31 KiB) Viewed 3216 times
ผลลัพธ์ pass loop.PNG
ผลลัพธ์ pass loop.PNG (2.91 KiB) Viewed 3216 times
ผลลัพธ์ while statement.PNG
ผลลัพธ์ while statement.PNG (3.04 KiB) Viewed 3216 times
รูปแบบการเขียน for.PNG
รูปแบบการเขียน for.PNG (4.58 KiB) Viewed 3216 times
รูปแบบการเขียน if.PNG
รูปแบบการเขียน if.PNG (7.44 KiB) Viewed 3216 times
  • Similar Topics
    ตอบกลับ
    แสดง
    โพสต์ล่าสุด

ผู้ใช้งานขณะนี้

สมาชิกกำลังดูบอร์ดนี้: ไม่มีสมาชิกใหม่ และบุคลทั่วไป 90