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



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

Answer / 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

More PHP Interview Questions

Which is a perfect example of runtime polymorphism?

0 Answers  


How do you remove whitespace from the beginning and end of a $string variable?

0 Answers  


discuss the issue of software theft in ghana and how it has affected the economy

0 Answers  


Tell me what's the difference between include and require?

0 Answers  


How many types of session are there?

0 Answers  


What is the value for this auto incremented field user_pri_id?

0 Answers  


what is array_search() in php?

2 Answers  


Tell me what are magic methods?

0 Answers  


How can we submit a form without a submit button?

5 Answers   CTS,


What is php beginner?

0 Answers  


What is fulltextsearch

2 Answers   A1 Technology,


Which function parses an English textual date or time into Unix timestamp in PHP.

0 Answers  


Categories