PHP 5.6.30 Released

Manualul PHP

by:
Mehdi Achour
Friedhelm Betz
Antony Dovgal
Nuno Lopes
Hannes Magnusson
Georg Richter
Damien Seguy
Jakub Vrana
2017-01-18
Edited By: Peter Cowburn
by:
Traducerea în limba română:
Paul Dorneanu
Adrian Jurjică
Cristi Rădulescu
Valentin Tutu
Iulian Năstăsache
Daniel Toma
Dorel Năstasă
Dan Matornei
Rareș Benea
Valentin Agachi
Cristi Armeana
Adrian Spinei
Cristian Câmpean
Șerban Gheorghe Ghiță
Gabriel Preda
Simion Onea
Alexandru Szasz
add a note add a note

User Contributed Notes 2 notes

up
-8
webtechhelp dot org at gmail dot com
10 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
-8
webtechhelp dot org at gmail dot com
10 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