Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

write a program to print
[123]
[456]
[789]
note : braces also need to be printed

Answer Posted / soujj

$countr = 0;
for($i=1;$i<=9;$i++)
{
$countr++;
$str[] = $i;
if($countr % 3 == 0)
{
echo "[";
for($j=0;$j<=2;$j++)
{
echo $str[$j];
}
echo "]";
$str=array();
}
}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can you extend a final defined class?

8998


Explain me what are the main error types in php and how do they differ?

1004


What is cookie in php with example?

957


What are include() and require() functions?

966


Describe session in php.

1069


Is salary fixed or variable cost?

1018


What is $this in php?

986


What is the main function of php?

1150


Explain soundex() and metaphone().

1037


How to connect to mysql from a php script?

1072


How can we create a database using php?

1130


How are cookies created?

969


Write a program to show the joining of two strings in php?

967


How is it possible to propagate a session id?

1011


Why sessions are used in php?

968