For each in Php


For each loop is used only for array

E.g


//You are splitting the word

$a="SachinTendulkar";
$b=str_split($a);

// To print each letter in that array you can use a For each loop

foreach($b as $c)
{
echo $c;
echo "\n";
}

?>

This is the basic example of For Each Loop in Php



Common Explanations

MOPED is the short term for ‘Motorized Pedaling’.

POP MUSIC is ‘Popular Music’ shortened.

BUS is the short term for ‘Omnibus’ that means everybody.

FORTNIGHT comes from ‘Fourteen Nights’ (Two Weeks).

DRAWING ROOM was actually a ‘withdrawing room’ where people withdrew
after Dinner. Later the prefix ‘with’ was dropped.

NEWS refers to information from Four directions N, E, W and S.

AG-MARK, which some products bear, stems from ‘Agricultural Marketing’.

JOURNAL is a diary that tells about ‘Journey for a day’ during each
Day’s business.
QUEUE comes from ‘Queen’s Quest’. Long back a long row of people as
waiting to see the Queen. Someone made the comment Queen’s Quest.

TIPS come from ‘To Insure Prompt Service’. In olden days to get Prompt
service from servants in an inn, travelers used to drop coins in a Box
on which was written ‘To Insure Prompt Service’. This gave rise to the
custom of Tips.

JEEP is a vehicle with unique Gear system. It was invented during
World War II (1939-1945). It was named ‘General Purpose Vehicle
(GP)’.GP was changed into JEEP later.



If Else Loop in Php

If Else loop in Php

Program to calculate biggest of 3 numbers

$a=5;
$b=6;
$c=7;

//$a is a variable

If (($a>$b) && ( $a >$c))
{

echo “$a is the greatest number”;

}
else
{
if (($b>$c)&&($b>$a))
{

echo “$b is the greatest number”;
}
else
{

echo “$c is the greatest number”;
}

}
?>

This is basic example of If Else loop in Php.



Imposters on Facebook,Orkut and Twitter..

As usual I was updating my profile in Facebook but in one of my
classmates -Friend’s list I saw Asin as his friend ..I could n’t believe
that as It looked very genuine .

Here is the link of the profile:


http://www.facebook.com/profile.php?id=1582600341


But then again had a closer look at that I found some glaring mistakes
which made me investigate further

In Asin’s Fake Facebook Profile

a)Her Religion is denoted as Hindu whereas She is a Christian
b)There were some glaring spelling mistakes also on the profilev(Telugu was
denoted as Telungu)

So did further search on Google and came up with this article..


http://www.bollywoodhungama.com/news/2009/08/11/13162/index.html

Which says all about it..



Php Variables

L2-Php Variables

Php Variables are one the easiest way to define.

You do n’t have to write int or string before it .you can just take a
variable and use it

E.g

<?

$a="India"

echo $a;

?>

This will output “India”

<?

$a="12345"

echo $a;

This will output “12345″

?>



Output a Value in Php -Echo And Print


L1-Echo and Print

To output a value in Php you simply need to use either of these commands

echo “India”;

Output:India

or

print “India”

Output “India”