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 call by reference in php?
What is mod_php?
What does php exit do?
What are the features of php 7?
What is the maximum size of a file that can be uploaded using PHP and how can we change this?
What is __ invoke in php?
What are the features and advantages of object-oriented programming in php?
Why do we use sessions in php?
Which function would you use to read a line of data from a file in php?
What is the difference between apache vs niginx?
What is multidimensional array in php?
What is a controller in php?