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

How to differentiate isset and empty

6 Answers   A1 Technology, Dass Infotech, Microface,


What are the different ways we can retrive the mysql results using php ? Explain each

1 Answers  


Is php faster than nodejs?

0 Answers  


How to access standard error stream in PHP?

0 Answers  


What is the difference between md5(), crc32() and sha1() crypto on php?

0 Answers  






How can I load data from a text file into a table?

0 Answers  


What exactly is PHP?

0 Answers  


how can i get USA time using php...

1 Answers  


write function of the sentence traversal passing the parameter, e.g input:this is input sentence. output:sentence input is this.

1 Answers   HyperQuality,


What Is a Persistent Cookie?

0 Answers  


Which function Returns the time of sunrise for a given day / location in PHP.

0 Answers  


What are the differences between GET and POST methods in form submitting?

0 Answers  


Categories