-1

How can I fix this script? The result that I'm looking for is

The number is: 1 and  <iframe src="demo_iframe.htm" height="200" width="300"></iframe>
The number is: 2 and  <iframe src="demo_iframe.htm" height="200" width="300"></iframe>
The number is: 3 and  <iframe src="demo_iframe.htm" height="200" width="300"></iframe>

and i use this script

<?php  
for ($x = 0; $x <= 10; $x++) {
  echo "The number is: $x and  <iframe src="demo_iframe.htm" height="200" width="300"></iframe> <br>";
}
?>  

</body>
</html>

But the result is an error.

Paul Floyd
  • 5,530
  • 5
  • 29
  • 43
Fian Julio
  • 39
  • 6
  • 1
    look at your quotes –  Aug 17 '16 at 05:01
  • Welcome to StackOverflow! When asking questions like this always *include the error you got*. It can be vital to diagnosing more complex problems. In this case though .. ya, fix your quotes. And consider using `printf()` instead of `echo`. – ghoti Sep 22 '17 at 11:58

2 Answers2

2
   <?php  
    for ($x = 0; $x <= 10; $x++) {
      echo 'The number is: '.$x.' and  <iframe src="demo_iframe.htm" height="200" width="300"></iframe> <br>';
    }
    ?> 
Kalaivani M
  • 1,250
  • 15
  • 29
2
for ($x = 0; $x <=10; $x++) {

echo "The number is:".$x.' and <iframe src="demo_iframe.htm" height="200" width="300"></iframe> <br>';
 }
Passionate Coder
  • 7,154
  • 2
  • 19
  • 44