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 function do we use to find length of string, and length of array?
Can we override static method in php?
How to split a string into array using php?
Explain the difference between isset() and empty()?
Do you know how can we check the value of a given variable is a number?
What is the use of strpos in php?
Tell me what type of operation is needed when passing values through a form or an url?
How to delete a file from the system?
How to create a session? How to set a value in session?
Which php global variable is used for uploading a file?
What are the functions of string?
how can i develop forum code? any one pleale help me on this question
Tell me how comparison of objects is done in php5?
What are different types of Print Functions available in PHP?
What is the best way to test the strpos() return value in php?