我从我的html页面的论坛获得了这个Javascript代码:
<html>
<head>
<title>Countdown</title>
<script type="text/javascript">
// set minutes
var mins = 0.1;
// calculate the seconds (don't change this! unless time progresses at a different speed for you...)
var secs = mins * 60;
function countdown() {
setTimeout('Decrement()',1000);
}
function Decrement() {
if (document.getElementById) {
minutes = document.getElementById("minutes");
seconds = document.getElementById("seconds");
// if less than a minute remaining
if (seconds < 59) {
seconds.value = secs;
} else {
minutes.value = getminutes();
seconds.value = getseconds();
}
secs--;
setTimeout('Decrement()',1000);
} …
Run Code Online (Sandbox Code Playgroud) 我有这个代码:
echo $b1[1][wood]; // It would say 100
Run Code Online (Sandbox Code Playgroud)
但我想改变$ b1中的1,例如:
$id = 1;
echo $b(The $id here)[1][wood];
Run Code Online (Sandbox Code Playgroud)
我试过了
echo $b'.$id.'[1][wood];
Run Code Online (Sandbox Code Playgroud)
但它没有用.有没有人有什么建议 ?
谢谢