Presentation is loading. Please wait.

Presentation is loading. Please wait.

PHP-language, loops Jouni Juntunen Oulu University of Applied Sciences

Similar presentations


Presentation on theme: "PHP-language, loops Jouni Juntunen Oulu University of Applied Sciences"— Presentation transcript:

1 PHP-language, loops Jouni Juntunen Oulu University of Applied Sciences
School of Business and Information Management

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 Jouni Juntunen Oulu University of Applied Sciences"

Similar presentations


Ads by Google