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 difference between html and php?

484


Tell me what is the actually used php version?

544


What is member function?

539


What is a lambda function in php?

576


What is the function used to change the root directory in PHP?

534






Is wordpress a php framework?

495


Is runtime polymorphism overriding?

477


Do you know what is the differences between $a != $B and $a !== $B?

473


What is class extend in php?

515


How to call a php function from another php file?

479


Does php have multiple inheritance?

485


How to turn on the session support?

556


Why we use get in php?

546


Is php strongly typed?

587


Tell me how do I check if a given variable is empty?

520