PHP 5.6.30 Released

PHP 手册

by:
Mehdi Achour
Friedhelm Betz
Antony Dovgal
Nuno Lopes
Hannes Magnusson
Georg Richter
Damien Seguy
Jakub Vrana
2017-01-21
Edited By: Peter Cowburn
中文翻译人员:
肖盛文
洪建家
穆少磊
宋琪
黄啸宇
王远之
肖理达
乔楚
戴劼
褚兆玮
add a note add a note

User Contributed Notes 2 notes

up
-13
webtechhelp dot org at gmail dot com
12 days ago
Fibonacci Series Program in PHP

<?php

function printFibonacci($n)
{

 
$first = 0;
 
$second = 1;

  echo
"Fibonacci Series \n";

  echo
$first.' '.$second.' ';

  for(
$i = 2; $i < $n; $i++){

   
$third = $first + $second;

    echo
$third.' ';

   
$first = $second;
   
$second = $third;

    }
}
 
/* Function call to print Fibonacci series upto 6 numbers. */

printFibonacci(6);

?>

http://webtechhelp.org
up
-16
webtechhelp dot org at gmail dot com
12 days ago
How to generate series in php with number gets multipled by 6 after every 2 numbers

<?php
function getNumber($i) {
    if (
$i % 3 == 0) {
        return
$i * 2;
    } else {
        return
$i;
    }
}

for (
$i = 1; $i <= 1000; $i++) {
    echo
getNumber($i) . "\n";
}
?>
To Top