write a program to print
[123]
[456]
[789]
note : braces also need to be printed
Answer Posted / 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 View All Answers
What is the difference between a session and cookies?
Tell me what does the initials of php stand for?
Do while loops?
What is the current php version?
How do I check environment variables?
What is difference between sql and php?
What is the definition of a session?
Explain how can we increase the execution time of a php script?
What are the rules for naming a php variable?
What is the difference between characters 23 and x23?
What are the two main string operators?
Which one is best framework for php?
What is a persistence cookie?
Does https prevent csrf?
What is the function to count elements in an array in PHP?