quick links

PHP Programme

Print only odd number

<?php
for($i=1; $i<=25; $i++) {
if($i%2 == 0) {
$even[] = $i;
} else {
$odd[] = $i;
}
}
echo implode(",",$odd);
?>

Swap number without third variable.

<?php
$a=12;
$b=15;
$a=$a+$b;
$b=$a-$b;
$a=$a-$b;
echo $a."<br />".$b;
?>

There are three way to find max value in array

There are three way to find min value in array

Enter value of $n

<?php
$n = 2;
$array = array(44,16,81,12);
$unique = array();
$unique = array_unique($array);
sort($unique);
echo $height = $unique[count($unique)-$n];
?>

A prime number is a whole number greater than 1 whose only factors are 1 and itself.

Factorial of a non-negative integer, is multiplication of all integers smaller than or equal to n. For example factorial of 5 is 5*4*3*2*1 which is 120.

A series of numbers in which each number ( Fibonacci number ) is the sum of the two preceding numbers. The simplest is the series 1, 1, 2, 3, 5, 8, etc.

Below are the diffrent pattern like star, 123 etc...

<?php
$a = '1';
$b = &$a;
$b = "2$b";
echo $a.", ".$b;
?>
 

About Us

Joomla Web Solution

We love working with PHP, HTML5, CSS3, jQuery and the most-loved content management framework in the world, Joomla!

LIKE US ON FACEBOOK