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
What is difference between html and php?
Tell me what is the actually used php version?
What is member function?
What is a lambda function in php?
What is the function used to change the root directory in PHP?
Is wordpress a php framework?
Is runtime polymorphism overriding?
Do you know what is the differences between $a != $B and $a !== $B?
What is class extend in php?
How to call a php function from another php file?
Does php have multiple inheritance?
How to turn on the session support?
Why we use get in php?
Is php strongly typed?
Tell me how do I check if a given variable is empty?