我正在嘗試構建一個代碼片段,稍後會將其插入一段代碼中。附加一個帶有html代碼的字符串
到目前爲止各種工作都很好,但有一個問題: 我還沒有想出如何實現ONCHANGE部分。 該值被成功檢測到,但我沒有得到一個很好的index.php?day = 23424234組合。我想這是關於轉義字符的東西?
有人會幫助我嗎?
$dayChoser = ' <form name="day">
<select ONCHANGE="location = index.php?day=this.options[this.selectedIndex].value;">
';
foreach ($tageArray as $ts) {
$tempDay = date('m/d/Y', $ts);
$dayChoser.='<option value=' . $ts . '>' . $tempDay . '</option>';
}
$dayChoser.='</select> </form>';
什麼是$ tageArray變量?猜猜一些數組,對嗎? – Wh1T3h4Ck5 2011-03-31 19:11:21
@ Wh1T3h4Ck5 - 我認爲$ tageArray可能是一頭大象。 :P – 2011-03-31 19:14:39
可能是任何數據類型,甚至沒有聲明,我不知道它是什麼,所以我只是猜測。因爲它已經在foreach中使用過,並不意味着它是一個數組類型,或者我沒有看到任何東西。 – Wh1T3h4Ck5 2011-03-31 19:28:33