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

More Related Content

Viewers also liked

Technical+presentation+4+seminar
Technical+presentation+4+seminarTechnical+presentation+4+seminar
Technical+presentation+4+seminaramitbabbar1
 
Business Continuity for the Small to Medium Business
Business Continuity for the Small to Medium BusinessBusiness Continuity for the Small to Medium Business
Business Continuity for the Small to Medium Businessscottbh
 
What QAHS staff are reading
What QAHS staff are readingWhat QAHS staff are reading
What QAHS staff are readingqldacademies
 
Clever Creative Global - Queensland Academies Creative Industries Campus
Clever Creative Global - Queensland Academies Creative Industries CampusClever Creative Global - Queensland Academies Creative Industries Campus
Clever Creative Global - Queensland Academies Creative Industries Campusqldacademies
 
PRINT A5-SPIRALHIRES
PRINT A5-SPIRALHIRESPRINT A5-SPIRALHIRES
PRINT A5-SPIRALHIRESDita Koswara
 
On line parent information session
On line parent information sessionOn line parent information session
On line parent information sessionqldacademies
 
On line parent information session
On line parent information sessionOn line parent information session
On line parent information sessionqldacademies
 
Punctuation tips
Punctuation tipsPunctuation tips
Punctuation tipsKatang Isip
 
Binary Search Tree and AVL
Binary Search Tree and AVLBinary Search Tree and AVL
Binary Search Tree and AVLKatang Isip
 
Baromètre TIC 2013 de la Wallonie. Citoyens. Entreprises. Education
Baromètre TIC 2013 de la Wallonie. Citoyens. Entreprises. EducationBaromètre TIC 2013 de la Wallonie. Citoyens. Entreprises. Education
Baromètre TIC 2013 de la Wallonie. Citoyens. Entreprises. EducationAgence du Numérique (AdN)
 
Enib cours c.a.i. web - séance #1 - html5 css3-js - 1
Enib   cours c.a.i. web - séance #1 - html5 css3-js - 1Enib   cours c.a.i. web - séance #1 - html5 css3-js - 1
Enib cours c.a.i. web - séance #1 - html5 css3-js - 1Horacio Gonzalez
 
Spotme Training Solutions for the Automotive Manufacturer Industry
Spotme Training Solutions for the Automotive Manufacturer IndustrySpotme Training Solutions for the Automotive Manufacturer Industry
Spotme Training Solutions for the Automotive Manufacturer IndustryAndy Frezza
 
Internet, réseaux sociaux, mobilité: de nouvelles stratégies en oeuvre dans l...
Internet, réseaux sociaux, mobilité: de nouvelles stratégies en oeuvre dans l...Internet, réseaux sociaux, mobilité: de nouvelles stratégies en oeuvre dans l...
Internet, réseaux sociaux, mobilité: de nouvelles stratégies en oeuvre dans l...Audrey Defretin
 

Viewers also liked (20)

Technical+presentation+4+seminar
Technical+presentation+4+seminarTechnical+presentation+4+seminar
Technical+presentation+4+seminar
 
Business Continuity for the Small to Medium Business
Business Continuity for the Small to Medium BusinessBusiness Continuity for the Small to Medium Business
Business Continuity for the Small to Medium Business
 
What QAHS staff are reading
What QAHS staff are readingWhat QAHS staff are reading
What QAHS staff are reading
 
Clever Creative Global - Queensland Academies Creative Industries Campus
Clever Creative Global - Queensland Academies Creative Industries CampusClever Creative Global - Queensland Academies Creative Industries Campus
Clever Creative Global - Queensland Academies Creative Industries Campus
 
Answer unit1.2
Answer unit1.2Answer unit1.2
Answer unit1.2
 
PRINT A5-SPIRALHIRES
PRINT A5-SPIRALHIRESPRINT A5-SPIRALHIRES
PRINT A5-SPIRALHIRES
 
Unit2flowchart
Unit2flowchartUnit2flowchart
Unit2flowchart
 
On line parent information session
On line parent information sessionOn line parent information session
On line parent information session
 
On line parent information session
On line parent information sessionOn line parent information session
On line parent information session
 
Intro program php
Intro program phpIntro program php
Intro program php
 
Unit4maintain
Unit4maintainUnit4maintain
Unit4maintain
 
Unit1 ph pprogram
Unit1 ph pprogramUnit1 ph pprogram
Unit1 ph pprogram
 
Unit3.1variables
Unit3.1variablesUnit3.1variables
Unit3.1variables
 
Punctuation tips
Punctuation tipsPunctuation tips
Punctuation tips
 
Time complexity
Time complexityTime complexity
Time complexity
 
Binary Search Tree and AVL
Binary Search Tree and AVLBinary Search Tree and AVL
Binary Search Tree and AVL
 
Baromètre TIC 2013 de la Wallonie. Citoyens. Entreprises. Education
Baromètre TIC 2013 de la Wallonie. Citoyens. Entreprises. EducationBaromètre TIC 2013 de la Wallonie. Citoyens. Entreprises. Education
Baromètre TIC 2013 de la Wallonie. Citoyens. Entreprises. Education
 
Enib cours c.a.i. web - séance #1 - html5 css3-js - 1
Enib   cours c.a.i. web - séance #1 - html5 css3-js - 1Enib   cours c.a.i. web - séance #1 - html5 css3-js - 1
Enib cours c.a.i. web - séance #1 - html5 css3-js - 1
 
Spotme Training Solutions for the Automotive Manufacturer Industry
Spotme Training Solutions for the Automotive Manufacturer IndustrySpotme Training Solutions for the Automotive Manufacturer Industry
Spotme Training Solutions for the Automotive Manufacturer Industry
 
Internet, réseaux sociaux, mobilité: de nouvelles stratégies en oeuvre dans l...
Internet, réseaux sociaux, mobilité: de nouvelles stratégies en oeuvre dans l...Internet, réseaux sociaux, mobilité: de nouvelles stratégies en oeuvre dans l...
Internet, réseaux sociaux, mobilité: de nouvelles stratégies en oeuvre dans l...
 

More from KwanJai Cherubstar (15)

Introprogramphp
IntroprogramphpIntroprogramphp
Introprogramphp
 
Programstructure
ProgramstructureProgramstructure
Programstructure
 
ความรู้เบื้องต้นเกี่ยวกับภาษาPhp
ความรู้เบื้องต้นเกี่ยวกับภาษาPhpความรู้เบื้องต้นเกี่ยวกับภาษาPhp
ความรู้เบื้องต้นเกี่ยวกับภาษาPhp
 
Unit4maintain edit
Unit4maintain editUnit4maintain edit
Unit4maintain edit
 
Unit3coding
Unit3codingUnit3coding
Unit3coding
 
Answer unit4.4.1
Answer unit4.4.1Answer unit4.4.1
Answer unit4.4.1
 
Answer unit4.2.1
Answer unit4.2.1Answer unit4.2.1
Answer unit4.2.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.1
Answer unit1.1Answer unit1.1
Answer unit1.1
 
Program structure
Program structureProgram structure
Program structure
 

Answer unit4.2.5

  • 1. 1. ให้นักเรียนเขียนโปรแกรมแสดงผลคำว่ำ "HELLO" เริ่มต้นตัวอักษรที่ระดับ 1 และน้อยกว่ำ 7 โดยมีตัวอักษรสีนำเงิน 2. ให้นักเรียนเขียนโปรแกรมกำรเพิ่มค่ำตัวแปร$totalและ$iโดยกำหนดค่ำตัวแปรเริ่มต้นที่ 0 และ 1 ตำมลำดับแสดงผลตัวแปร$i <?php $size = 1; while ($size < 7) { echo "<font size = $size color=blue>HELLO<br>"; $size++; } ?> <?PHP $total=0; $i=1; while($i<=5) { print $i.”<BR>”; $a+= $total+1; $b++; } ?>
  • 2. 3. ให้นักเรียนเขียนโปรแกรมกำรแสดงผลว่ำ สวัสดี PHP 3 ครัง โดยกำหนดค่ำตัวแปรเริ่มต้นที่ 0และค่ำสูงสุดที่น้อยกว่ำเท่ำกับ 3ใช้คำสั่งwhile <? $i=1; while($i<=3) { echo"สวัสดี PHP 3 ครัง<br>"; $i++; }?>
  • 3. 4. ให้นักเรียนเขียนโปรแกรมกำรแสดงผลว่ำ ค่ำ m เพิ่มขึนทีละ 5 ค่ำ M ที่ได้ จะเท่ำกับจำนวน ครังที่กำหนดในตัวแปรโดยกำหนดค่ำตัวแปรเริ่มต้นที่0และค่ำสูงสุดที่น้อยกว่ำเท่ำกับ 5 <? $m=0; $i=1; while($i<=5) { $m = $m + 5; echo"ค่ำ m เพิ่มขึนทีละ 5 ค่ำ M ที่ได้ จะเท่ำกับ $m <br>"; $i++; } ?>