Presentation is loading. Please wait.

Presentation is loading. Please wait.

PHP-language, loops Teppo Räisänen Principal Lecturer Oulu University of Applied Sciences School of Business and Information Management

Similar presentations


Presentation on theme: "PHP-language, loops Teppo Räisänen Principal Lecturer Oulu University of Applied Sciences School of Business and Information Management"— Presentation transcript:

1 PHP-language, loops Teppo Räisänen Principal Lecturer Oulu University of Applied Sciences School of Business and Information Management teppo.raisanen@oamk.fi, 050 382 6587

2 Loops While For …

3 Example Print HTML-table using for

4 While initialization while (condition) { //one or more statemens incrementation }

5 Example Calculating compound interest using while <? $loan=100; $interest=10; $years=3; $i=0; while ($i < $years) { $loan=$loan+ ($loan / 100) * $interest; $i++; } print ”Total amount of loan is $loan”; ?>

6 For For (initialization;condition;increment) { //one or more statemens }

7 Example Calculating compound interest using for <? $loan=100; $interest=10; $years=3; for ($i=0;$i<$years;$i++); { $loan=$loan + ($loan / 100) * $interest; } print ”Total amount of loan is $loan”; ?>


Download ppt "PHP-language, loops Teppo Räisänen Principal Lecturer Oulu University of Applied Sciences School of Business and Information Management"

Similar presentations


Ads by Google