2016-08-17 14 views
-1

このスクリプトを修正するにはどうすればよいですか?私が探している 結果はiframeでPHPループエラーが発生する

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> 

であり、私はこのスクリプト

<?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> 

を使用しますが、結果がエラーです。あなたの引用符で

+1

見にStackOverflowに –

+0

ようこそ!このような質問をいつでも*あなたが持っているエラーを*含む。より複雑な問題を診断することは非常に重要です。しかし、この場合には、あなたの引用符を修正してください。そして、 'echo'の代わりに' printf() 'を使うことを検討してください。回答のための – ghoti

答えて

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>'; 
    } 
    ?> 
+0

thx:答えのための –

2
for ($x = 0; $x <=10; $x++) { 

echo "The number is:".$x.' and <iframe src="demo_iframe.htm" height="200" width="300"></iframe> <br>'; 
} 
+0

のthx: –

+0

ようこそFian Julio :) – user1234

関連する問題