write a program to print
[123]
[456]
[789]
note : braces also need to be printed
Answer Posted / sumit manchanda
<?php
$count=0;
echo "[";
for($i=1;$i<10;$i++){
if($i%3==0){
echo "$i";
echo "]";
echo "</br>";
$count++;
}else{
if($count==3){
echo "[";
$count=0;
}
$count=$count+1;
echo "$i";
}
}
?>
| Is This Answer Correct ? | 11 Yes | 1 No |
Post New Answer View All Answers
Does php 7 support mysql?
How many escape sequences are recognized in double-quoted strings?
Xplain is it possible to use com component in php?
What is the difference server side and browser side validation?
How does php server work?
How to convert a string to lowercase in php?
What is the use of strip_tags() method?
Write a select query that will be displayed the duplicated site name and how many times it is duplicated?
What is the sign to start variables in PHP?
how retrive the video file in php using video tag
Write a program to upload a file in php?
What is the use of $_server and $_env?
What is faster?
Explain what is memcache?
Explain the value of the variable input is a string 1,2,3,4,5,6,7. How would you get the sum of the integers contained inside input?