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 |
What is fetch array in php?
equivalent code for the following c program in php void main() { int i=5;printf("%d",i); }
How can we automatically escape incoming data?
What is encapsulation in php?
Why do we need abstract class in php?
List some string function name in php?
How to define a user function?
How many different types of messages available in php?
What is class extend in php?
When to use get and post request?
What is a trait in php?
Can we override static method in php?