所以......我把一些代码住一天(即工作我的本地机器上100%的罚款),但杀了服务器-没有笨日志,没有Apache日志,die('msg')
并exit()
没有工作-我从来没有在之前经历过5+多年的PHP开发.
在50多次提交到我的回购之后,我将问题缩小到一个声明,该声明在拆分时有效,但不能在一起.
系统信息:
PHP版本:5.4.13
Codeigniter版本:
define('CI_VERSION', '2.1.3');
这些行有效(在Codeigniter MY_Controller函数中调用):
dump($this->get_val('order_id'));
$tmp = $this->get_val('order_id');
dump($tmp);
dump(empty($tmp));
dump(!empty($tmp));
Run Code Online (Sandbox Code Playgroud)
但是当我添加以下行时,会发生上述崩溃:
!empty($this->get_val('order_id'))
Run Code Online (Sandbox Code Playgroud)
这似乎是一个PHP错误?
<?php
if (!defined('BASEPATH'))
exit('No direct script access allowed');
class Main extends Administration {
function index() {
// if (!empty($in['order_id'])) { /* BROKEN */
dump($this->get_val('order_id'));
$tmp = $this->get_val('order_id');
dump($tmp);
dump(empty($tmp));
dump(!empty($tmp));
// dump(!empty($this->get_val('order_id'))); /* BROKEN */
// if (!empty($this->get_val('order_id'))) { /* BROKEN */
// dump(true);
// } else {
// dump(false);
// }
}
}
Run Code Online (Sandbox Code Playgroud)
我有一个简单的 PHP 一维数组。
当我执行 var dump ( echo var_dump($a)
) 时,我将其作为输出:
array(3) { [0]=> string(3) "?" [1]=> string(21) "exhausted||to exhaust" [2]=> string(4) "jin3" }
Run Code Online (Sandbox Code Playgroud)
但是,当我对它进行 json_encode ( echo json_encode($a)
) 时,我得到了这个:
["\u5c3d","exhausted||to exhaust","jin3"]
Run Code Online (Sandbox Code Playgroud)
它返回的十六进制值是正确的,但我不知道如何阻止它给我十六进制。我只是想让它显示字符。
如果我echo mb_internal_encoding()
返回 UTF-8,这就是我设置的。我在所有字符串操作中都非常小心地使用 mb_ 函数,因此没有任何数据被弄乱。
我知道我可以编写一个修改过的 json_encode 函数来解决这个问题。但我想知道这里发生了什么。
像这个问题,我是Python新手.
我使用PyDev - OSX 10.8.1在Eclipse Juno中运行以下简单程序.我想传递一个stdin
流.如果我在命令行中运行它,它将如下所示:
python main.py <test_input.txt
我如何将其添加到我的eclipse项目的参数中?
import sys
def getArgs():
if sys.stdin.isatty():
for line in sys.stdin:
print line
def main():
getArgs()
if __name__ == "__main__":
main()
Run Code Online (Sandbox Code Playgroud) 就像这个问题所述 - 我想将点击(2D)转换为与屏幕上的渲染相关的坐标。我将函数glutMouseFunc
绑定到我的函数(如下),但无法理解传入的 x 和 y - 它们似乎与距左上角的像素距离有关。
我想知道如何将 x 和 y 转换为世界坐标:)
void mouse(int button, int state, int x, int y) {
switch(button) {
case GLUT_LEFT_BUTTON:
printf(" LEFT ");
if (state == GLUT_DOWN) {
printf("DOWN\n");
printf("(%d, %d)\n", x, y);
}
else
if (state == GLUT_UP) {
printf("UP\n");
}
break;
default:
break;
}
fflush(stdout); // Force output to stdout
}
Run Code Online (Sandbox Code Playgroud) 我正在使用凉亭进行资产管理.Bootstrap bower repo随附了一个Gruntfile.js.
有没有办法从链接器中排除它?
我试过了:
var jsFilesToInject = [
'!**Gruntfile.js',
// ...
]
Run Code Online (Sandbox Code Playgroud)
但它不起作用 - 我把这个字符串放在错误的位置吗?
PS我按照本指南来到这里:StackOverFlow问题并运行bower install bootstrap
和bower install angular
.
我的错误是缺少jQuery运算符函数:
<script>
$(function() { // <-- THIS LINE
$('body').on('change', '#billing_country', function() {
console.log($('#billing_country').val());
$.post("/store/ajax_get_zones", {
country_id: $('#billing_country').val()
}, function(e) {
if (e)
$("#billing_state").html(e);
})
});
});
</script>
Run Code Online (Sandbox Code Playgroud)
谢谢第二双眼睛的家伙.(感谢@Adil提供极快的响应)
我在我的网站上运行了以下非常简单的代码,它没有明显的原因.我知道我已经完成了100次,由于某种原因它现在不能正常工作?
它的工作没有包含(function() { ... }
我做错了吗?
<div class="validate_the_fields_below" id="new_billing_address" style="">
<table class="form-table">
<tbody>
<tr class="field">
<td class="form-label"><label for="first_name">First Name*</label>
</td><td class="form-input"><input type="text" name="billing_first_name" value="" class="required"></td>
</tr>
<tr class="field">
<td class="form-label"><label for="last_name">Last Name*</label>
</td><td class="form-input"><input type="text" name="billing_last_name" value="" class="required"></td>
</tr>
<tr class="field">
<td class="form-label"><label for="phone">Phone*</label>
</td><td class="form-input"><input type="tel" …
Run Code Online (Sandbox Code Playgroud) 我正在寻找一个PHP,Codeigniter,Bootstrap 3表单生成器,但找不到一个.
codeigniter ×2
php ×2
2d ×1
c ×1
eclipse ×1
formbuilder ×1
gruntjs ×1
html ×1
input ×1
javascript ×1
jquery ×1
json ×1
mouseevent ×1
node.js ×1
opengl ×1
pydev ×1
python ×1
sails.js ×1
stdin ×1