有没有办法可以调用第二个函数 toggle(function(){},function(){})
我被困在一个php4服务器,我需要将脚本从php5转换为php4.
我需要将此代码转换为php4
$response = $this->parent->send('get_content_list', $tail);
Run Code Online (Sandbox Code Playgroud)
Thnx提前.
更新 这是我得到的错误:
Fatal error: Call to undefined method: stdClass->send()
Run Code Online (Sandbox Code Playgroud)
更新我在父类中有一个__constructor.我把它改成了班级名字,没关系!
谁能解释一下这个表达式是如何工作的?
type = type || 'any';
Run Code Online (Sandbox Code Playgroud)
如果type未定义,是否意味着使用'any'?
我有这个json填充我TableListCollection的模型集合()TableModel)
{
"tables": [
{
"tableId": 15,
"size": 8,
"occupiedSeats": 0,
"stakes": {
"smallBlindAmount": 10,
"bigBlindAmount": 20,
"minBuyInAmount": 20,
"maxBuyInAmount": 200
},
"gameType": "HOLDEM",
"gameSpeed": "NORMAL",
"friends": []
},
{
"tableId": 16,
"size": 8,
"occupiedSeats": 0,
"stakes": {
"smallBlindAmount": 20,
"bigBlindAmount": 40,
"minBuyInAmount": 20,
"maxBuyInAmount": 200
},
"gameType": "HOLDEM",
"gameSpeed": "NORMAL",
"friends": []
},
{
"tableId": 17,
"size": 8,
"occupiedSeats": 0,
"stakes": {
"smallBlindAmount": 40,
"bigBlindAmount": 60,
"minBuyInAmount": 20,
"maxBuyInAmount": 200
},
"gameType": "HOLDEM",
"gameSpeed": "NORMAL",
"friends": …Run Code Online (Sandbox Code Playgroud) 我想在$ _POST前加一个"0"
$currency = $_POST['Currency']; // lets say 900
$currency = "0".$currency;
echo $currency;
Run Code Online (Sandbox Code Playgroud)
它应该已经返回0900但它返回900.
有任何想法吗?
编辑
这是完整的功能
function validate(){
$ref = $this->input->post('Ref');
$shop = $this->input->post('Shop');
$amount = $this->input->post('Amount')*1000;
//$currency = $this->input->post('Currency');
//$currency = $_POST['Currency']; // lets say 900
//$currency = "0".$currency;
$currency = str_pad($_POST['Currency'],4,'0',STR_PAD_LEFT);
$query = $this->db->query("SELECT * FROM shop_validation WHERE merchant_ref = '$ref' ");
if($query->num_rows() > 0) {
$row = $query->row_array();
$posts = "";
foreach ($_POST as $name => $value) {
$posts .= $name." / ".$value;
}
$this->db->query("INSERT …Run Code Online (Sandbox Code Playgroud) 此代码中的模式不替换括号.我也试过"/(|)/ g".
var re = "/[^a-z]/g",
txt = navsel.options[i].text.split(" ")[0], // here I get the text from a select and I split it.
// What I expect is strings like "(en)" , "(el)" etc
txt = txt.replace(re," ")
Run Code Online (Sandbox Code Playgroud)
提前致谢
我继承了一个项目,它将php生成的页面保存到数据库中,然后根据需要从php控制器调用它们.我不明白为什么他们这样做......
php ×3
javascript ×2
backbone.js ×1
codeigniter ×1
git ×1
gitignore ×1
jquery ×1
logic ×1
regex ×1
toggle ×1