如何在setInterval函数中传递参数例如:
intId = setInterval(waiting(argument), 10000);
Run Code Online (Sandbox Code Playgroud)
它显示错误 : useless setInterval call (missing quotes around argument?)
是否可以在flot图中显示x和y轴的标题?
以下是代码:
$.plot($("#placeholder_1w"), [d], {
series: {
lines: { show: true, fill: false, fillColor: "red" },
points: { show: true, fill: true,fillColor: "red" }
},
grid: { hoverable: true, clickable: true , color: 'green'},
xaxis: {
mode: "time",
minTickSize: [1, "day"],
min: (myWeekDate).getTime(),
max: (new Date()).getTime()
},
colors: ["red", "green", "#919733"]
});
Run Code Online (Sandbox Code Playgroud) 我需要在foreach循环中使用PHP包含:
define('WEBS', 'http://google.com, http://yahoo.com');
foreach (WEBS as $a) {
//do something
}
Run Code Online (Sandbox Code Playgroud)
但是我设法通过以下代码来做到这一点,虽然它工作正常,但aptana编辑器显示语法错误.请指导我如何以正确的方式做到这一点.
foreach (get_defined_constants(true)['user']['WEBS'] as $w) {
//do something
}
Run Code Online (Sandbox Code Playgroud) 我的应用程序工作很慢.我正在使用Cakephp 2.3.1版本.在需要它们的函数中加载模型,组件和助手是否有益?现在我在课堂上打电话给他们.例如:
class PanelsController extends AppController {
public $name = 'Panel';
public $uses = array(list of models goes here);
public $components = array(list of components goes here);
.................
}
Run Code Online (Sandbox Code Playgroud)
你有什么其他技巧吗?谢谢
以下是保存联系信息的String.此字符串是动态的,即有时新字段例如:移动电话号码可能加起来或旧字段说:电话号码可能会删除.
<?php $str =
"tel: (123) 123-4567
fax : (234) 127-1234
email : abc@a.a";
$newStr = explode(':', $str);
echo '<pre>'; print_r($newStr);
?>
Run Code Online (Sandbox Code Playgroud)
输出的代码是:
Array
(
[0] => tel
[1] => (123) 123-4567
fax
[2] => (234) 127-1234
email
[3] => abc@a.a
)
Run Code Online (Sandbox Code Playgroud)
但所需的输出采用以下格式:
Array
(
[tel] => (123) 123-4567
[fax] => (234) 127-1234
[email] => abc@a.a
)
Run Code Online (Sandbox Code Playgroud)
我尝试过以某种方式爆炸......但是没有用.请指导.