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 are php variables?

0 Answers  


Explain some of the php string functions?

0 Answers  


What is the use of mysql_fetch_assoc in php?

0 Answers  


What types of loops exist in php?

0 Answers  


Which function would you use to replace a record in a database in php?

0 Answers  






Why do we use polymorphism in php?

0 Answers  


How to execute an sql query? How to fetch its result?

0 Answers  


What is the interface in php?

0 Answers  


How can you declare the array in php?

0 Answers  


Explain mail function in PHP with syntax?

0 Answers  


Does php support multiple inheritance?

0 Answers  


Is facebook still in php?

0 Answers  


Categories