Yuki 在 2016-12-10 16:24 星期六 提交
var QueryString = function () {
// This function is anonymous, is executed immediately and
// the return value is assigned to QueryString!
var query_string = {};
var query = window.location.search.substring(1);
var vars = query.split("&");
for (var i = 0; i < vars.length; i++) {
var pair = vars[i].split("=");
// If first entry with this name
if (typeof query_string[pair[0]] === "undefined") {
query_string[pair[0]] = decodeURIComponent(pair[1]);
Yuki 在 2015-12-04 16:31 星期五 提交
Windows 下 写PHP脚本 中文乱码。
设置php脚本文件格式为GBK。Windows脚本交互环境不支持UTF8。
太无知了,谁说不支持UTF8的。
在命令行下面执行 chcp 65001 即可。
Windows 10 存在无法保存设置的情况。修改注册表。
参考:
Yuki 在 2015-09-13 01:16 星期日 提交
<?php
class command_base {
private $php_path = '';
function real_path() {
if ($this->php_path != '') {
return $this->php_path;
}
if (substr(strtolower(PHP_OS), 0, 3) == 'win') {
$ini = ini_get_all();
$path = $ini['extension_dir']['local_value'];
$php_path = str_replace('\\', '/', $path);
$php_path = str_replace(array('/ext/', '/ext'), array(
'/',
'/'
), $php_path);
$real_path = $php_path . 'php.exe';
}
else {
$real_path = PHP_BINDIR . '/php';
}