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

What is call by reference in php?

0 Answers  


What is mod_php?

0 Answers  


What does php exit do?

0 Answers  


What are the features of php 7?

0 Answers  


What is the maximum size of a file that can be uploaded using PHP and how can we change this?

4 Answers  






What is __ invoke in php?

0 Answers  


What are the features and advantages of object-oriented programming in php?

0 Answers  


Why do we use sessions in php?

0 Answers  


Which function would you use to read a line of data from a file in php?

0 Answers  


What is the difference between apache vs niginx?

0 Answers  


What is multidimensional array in php?

0 Answers  


What is a controller in php?

0 Answers  


Categories