Download presentation
Presentation is loading. Please wait.
Published byAlfred Cook Modified over 9 years ago
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”; ?>
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.