2017-06-10 90 views
0

我想詢問是否可以將多個雙引號添加到輸入值,就像這樣:多雙引號

<input value= "<iframe src="http://xxx.xx/embed?t=<?php the_title(); ?>" 
width='640' height='360' 
allowscriptaccess='always' allowfullscreen='true' 
scrolling='no' frameborder='0'></iframe>" 

所以,整個元素雙引號內包裹着,就像src屬性(URL)的值,但URL不會包含在值中。

這可以實現嗎?

+1

[在PHP轉義引號(可能的重複https://stackoverflow.com/questions/ 7999148/escape-quotation-marks-in-php) – ShiraNai7

+0

它不重複,我有html值不是php,它不適用於html –

+0

爲什麼你用[php]標記你的問題呢? – ShiraNai7

回答

1

您可以嘗試使用轉義反斜線雙引號..... 欲瞭解更多信息請訪問How to properly escape quotes inside html attributes?

<input value= "<iframe src=&quot;http://xxx.xx/embed?t=<?php the_title(); ?>&quot; 
width=&quot;640&quot; height=&quot;360&quot; 
allowscriptaccess=&quot;always&quot; allowfullscreen=&quot;true&quot; 
scrolling=&quot;no&quot; frameborder=&quot;0&quot;></iframe>"