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

What is the difference between a session and cookies?

937


Tell me what does the initials of php stand for?

953


Do while loops?

953


What is the current php version?

1067


How do I check environment variables?

990


What is difference between sql and php?

1053


What is the definition of a session?

966


Explain how can we increase the execution time of a php script?

982


What are the rules for naming a php variable?

1036


What is the difference between characters 23 and x23?

987


What are the two main string operators?

1036


Which one is best framework for php?

966


What is a persistence cookie?

930


Does https prevent csrf?

899


What is the function to count elements in an array in PHP?

1084