SlideShare a Scribd company logo
1 of 2
Download to read offline
1. ให้นักเรียนเขียนโปรแกรมการแสดงผลว่า สวัสดี PHP 3 ครั้ง โดยกาหนดค่าตัวแปรเริ่มต้น
ที่ 0และค่าสูงสุดที่น้อยกว่าเท่ากับ 3
2. ให้นักเรียนเขียนโปรแกรมการแสดงผลว่า ค่า m เพิ่มขึ้นทีละ 5 ค่า M ที่ได้ จะเท่ากับ
จานวนครั้งที่กาหนดในตัวแปร โดยกาหนดค่าตัวแปรเริ่มต้นที่0และค่าสูงสุดที่น้อยกว่า
เท่ากับ 5
<?php
$i=0;
do
{
$i++;
echo "สวัสดี PHP". "<br />";
}
while ($i<=2);
?>
<?PHP
$a=1;
do
{
print $a."<BR>";
$a=$a+5;
$a++;
}
while($a<=10)
?>
3. ให้นักเรียนเขียนโปรแกรมการแสดงตัวเลขตั้งแต่ 1 ถึง 10
<?php
$i=0;
do
{
$i++;
echo "เลขที่" . $i . "<br />";
}
while ($i<10);
?>

More Related Content

What's hot (6)

Answer unit4.2.4
Answer unit4.2.4Answer unit4.2.4
Answer unit4.2.4
 
แบบฝึกหัด459
แบบฝึกหัด459แบบฝึกหัด459
แบบฝึกหัด459
 
Answer unit4.3.2
Answer unit4.3.2Answer unit4.3.2
Answer unit4.3.2
 
ตัวอย่างโปรแกรมลงBlog
ตัวอย่างโปรแกรมลงBlogตัวอย่างโปรแกรมลงBlog
ตัวอย่างโปรแกรมลงBlog
 
Week2
Week2Week2
Week2
 
Week3
Week3Week3
Week3
 

Viewers also liked

XOOPS Cube 2.2 Pack 2011
XOOPS Cube 2.2 Pack 2011XOOPS Cube 2.2 Pack 2011
XOOPS Cube 2.2 Pack 2011Yoshi Sakai
 
Genre and music expectations
Genre and music expectationsGenre and music expectations
Genre and music expectationscbirmingham123
 
10 Tips For Evoking Your Courage In The Face Of Uncertainty
10 Tips For Evoking Your Courage In The Face Of Uncertainty10 Tips For Evoking Your Courage In The Face Of Uncertainty
10 Tips For Evoking Your Courage In The Face Of UncertaintyRagini Michaels
 
compare.ppt
compare.pptcompare.ppt
compare.pptspnova
 
Conversa presentació família
Conversa presentació famíliaConversa presentació família
Conversa presentació famíliaJosase
 
Rivers joseph visualresumestoryboard
Rivers joseph visualresumestoryboardRivers joseph visualresumestoryboard
Rivers joseph visualresumestoryboardjoerocko
 
Lesson 22 tac
Lesson 22 tacLesson 22 tac
Lesson 22 tacjovillarr
 
Sp-12,8W2 Slideshare Presentation
Sp-12,8W2   Slideshare PresentationSp-12,8W2   Slideshare Presentation
Sp-12,8W2 Slideshare Presentationbgb02burns
 
New Microsoft Word Document
New Microsoft Word DocumentNew Microsoft Word Document
New Microsoft Word Documentakindrick
 
7 features about myself
7 features about myself7 features about myself
7 features about myselfTanhungkai
 
Mosaic Idol Scholarship Presentation
Mosaic Idol Scholarship PresentationMosaic Idol Scholarship Presentation
Mosaic Idol Scholarship PresentationLauren Meisner
 
Capturing Our Campus
Capturing Our CampusCapturing Our Campus
Capturing Our CampusTdbrown94
 
Newsletter dec09
Newsletter dec09Newsletter dec09
Newsletter dec09TUAT
 

Viewers also liked (17)

XOOPS Cube 2.2 Pack 2011
XOOPS Cube 2.2 Pack 2011XOOPS Cube 2.2 Pack 2011
XOOPS Cube 2.2 Pack 2011
 
Bigrental eg
Bigrental egBigrental eg
Bigrental eg
 
Genre and music expectations
Genre and music expectationsGenre and music expectations
Genre and music expectations
 
10 Tips For Evoking Your Courage In The Face Of Uncertainty
10 Tips For Evoking Your Courage In The Face Of Uncertainty10 Tips For Evoking Your Courage In The Face Of Uncertainty
10 Tips For Evoking Your Courage In The Face Of Uncertainty
 
compare.ppt
compare.pptcompare.ppt
compare.ppt
 
Conversa presentació família
Conversa presentació famíliaConversa presentació família
Conversa presentació família
 
Rivers joseph visualresumestoryboard
Rivers joseph visualresumestoryboardRivers joseph visualresumestoryboard
Rivers joseph visualresumestoryboard
 
Lesson 22 tac
Lesson 22 tacLesson 22 tac
Lesson 22 tac
 
Bs Soul
Bs SoulBs Soul
Bs Soul
 
Barulhinhonomotor Bel 1
Barulhinhonomotor Bel 1Barulhinhonomotor Bel 1
Barulhinhonomotor Bel 1
 
Sp-12,8W2 Slideshare Presentation
Sp-12,8W2   Slideshare PresentationSp-12,8W2   Slideshare Presentation
Sp-12,8W2 Slideshare Presentation
 
Readme
ReadmeReadme
Readme
 
New Microsoft Word Document
New Microsoft Word DocumentNew Microsoft Word Document
New Microsoft Word Document
 
7 features about myself
7 features about myself7 features about myself
7 features about myself
 
Mosaic Idol Scholarship Presentation
Mosaic Idol Scholarship PresentationMosaic Idol Scholarship Presentation
Mosaic Idol Scholarship Presentation
 
Capturing Our Campus
Capturing Our CampusCapturing Our Campus
Capturing Our Campus
 
Newsletter dec09
Newsletter dec09Newsletter dec09
Newsletter dec09
 

More from KwanJai Cherubstar (20)

Introprogramphp
IntroprogramphpIntroprogramphp
Introprogramphp
 
Programstructure
ProgramstructureProgramstructure
Programstructure
 
ความรู้เบื้องต้นเกี่ยวกับภาษาPhp
ความรู้เบื้องต้นเกี่ยวกับภาษาPhpความรู้เบื้องต้นเกี่ยวกับภาษาPhp
ความรู้เบื้องต้นเกี่ยวกับภาษาPhp
 
Unit3.1variables
Unit3.1variablesUnit3.1variables
Unit3.1variables
 
Unit4maintain edit
Unit4maintain editUnit4maintain edit
Unit4maintain edit
 
Unit4maintain
Unit4maintainUnit4maintain
Unit4maintain
 
Unit3coding
Unit3codingUnit3coding
Unit3coding
 
Unit2flowchart
Unit2flowchartUnit2flowchart
Unit2flowchart
 
Unit1 ph pprogram
Unit1 ph pprogramUnit1 ph pprogram
Unit1 ph pprogram
 
Answer unit4.4.1
Answer unit4.4.1Answer unit4.4.1
Answer unit4.4.1
 
Answer unit4.3.1
Answer unit4.3.1Answer unit4.3.1
Answer unit4.3.1
 
Answer unit4.1.1
Answer unit4.1.1Answer unit4.1.1
Answer unit4.1.1
 
Answer unit3.2
Answer unit3.2Answer unit3.2
Answer unit3.2
 
Answer unit3.1
Answer unit3.1Answer unit3.1
Answer unit3.1
 
Answer unit2.3
Answer unit2.3Answer unit2.3
Answer unit2.3
 
Answer unit2.1
Answer unit2.1Answer unit2.1
Answer unit2.1
 
Answer unit1.3
Answer unit1.3Answer unit1.3
Answer unit1.3
 
Answer unit1.2
Answer unit1.2Answer unit1.2
Answer unit1.2
 
Answer unit1.1
Answer unit1.1Answer unit1.1
Answer unit1.1
 
Intro program php
Intro program phpIntro program php
Intro program php
 

Answer unit4.2.2