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

How To Get the Uploaded File Information in the Receiving Script?

0 Answers  


What is needed to be able to use image function?

0 Answers  


in PHP for pdf which library used?

0 Answers  


How can we check the value of a given variable is a number?

0 Answers  


How can I execute a PHP script using command line?

4 Answers   Sify,


How long is a php session valid?

0 Answers  


What is the capacity of mysql database?

0 Answers  


How do you use bcrypt for hashing passwords in php?

0 Answers  


Tell me how can we determine whether a variable is set?

0 Answers  


How can we encrypt the username and password using PHP?

3 Answers   Rushmore Consultancy,


Swap two variables value without using third variable in php ?

0 Answers   MCN Solutions,


Is session a cookie?

0 Answers  


Categories