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 are php variables?
Explain some of the php string functions?
What is the use of mysql_fetch_assoc in php?
What types of loops exist in php?
Which function would you use to replace a record in a database in php?
Why do we use polymorphism in php?
How to execute an sql query? How to fetch its result?
What is the interface in php?
How can you declare the array in php?
Explain mail function in PHP with syntax?
Does php support multiple inheritance?
Is facebook still in php?