Difference between revisions of "CSC220 fibonacci2.php"

From dftwiki3
Jump to: navigation, search
(Created page with '--~~~~ ---- <code><pre> <html> <META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE"> <PRAGMA NO-CACHE> <head> <title>Php variables</title> <body> <div> <?php $fibN = 1; $fibN_1…')
 
 
Line 48: Line 48:
  
 
<br />
 
<br />
[[Categoy:CSC220]][[Category:Php]]
+
[[Category:CSC220]][[Category:Php]]

Latest revision as of 18:32, 19 September 2010

--D. Thiebaut 23:26, 19 September 2010 (UTC)


<html>
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
<PRAGMA NO-CACHE>
<head>
<title>Php variables</title>
<body>
<div>

<?php

$fibN = 1;
$fibN_1 = 1;

print "<ul>";
for ( $count=2; $count<10; $count++ ) {
  $temp = $fibN + $fibN_1;
  $fibN_1 = $fibN;
  $fibN   = $temp;
  print "<li>fib[$count] = $fibN <br>";
}
print "</ul>";

?>
</div>
</body>
</html>