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

Do you know what is the difference between mysql_fetch_object() and mysql_fetch_array()?

0 Answers  


What is a controller php?

0 Answers  


What is the meaning of php?

0 Answers  


Explain what are some new features introduced in php7?

0 Answers  


Which array function checks if the particular key exists in the array?

0 Answers  


Code to upload a file in PHP?

0 Answers  


Tell me what does the initials of php stand for?

0 Answers  


What is string and its function?

0 Answers  


How to use validations in php?(codelgniter)

2 Answers  


What are the uses of explode() function?

0 Answers  


Where session is stored?

0 Answers  


What is the maximum size of a table in mysql?

0 Answers  


Categories