fun_action
make an absolute URI from a relative one
http://php.net/manual/en/function.header.php
<?php
/* Redirect to a different page in the current directory that was requested */
$host = $_SERVER['HTTP_HOST'];
$uri = rtrim(dirname($_SERVER['PHP_SELF']), '/\\');
$extra = 'mypage.php';
header("Location: http://$host$uri/$extra");
exit;
?>
<?php
$start_unix = strtotime("2017-03-01");
echo $start_unix, '<br>';
$start_unix = strtotime("2017-03-01 00:00:01"); echo $start_unix, '<br>';
$start_unix = strtotime("2017-03-02"); echo $start_unix, '<br>';
1488297600
1488297601
1488384000
<?php
$start_unix = strtotime("2017-03-01");
echo $start_unix, '<br>';
for ($w = 0; $w < 31; $w++) {
$date_unix = $start_unix + $w * 24 * 3600;
$date = date('Y-m-d', $date_unix);
echo $date, '<br>';
} echo 'w';
1488297600
2017-03-01
2017-03-02
2017-03-03
2017-03-04
2017-03-05
2017-03-06
2017-03-07
2017-03-08
2017-03-09
2017-03-10
2017-03-11
2017-03-12
2017-03-13
2017-03-14
2017-03-15
2017-03-16
2017-03-17
2017-03-18
2017-03-19
2017-03-20
2017-03-21
2017-03-22
2017-03-23
2017-03-24
2017-03-25
2017-03-26
2017-03-27
2017-03-28
2017-03-29
2017-03-30
2017-03-31
http://docs.developer.amazonservices.com/zh_CN/orders/2013-09-01/Orders_ListOrders.html
指定某一格式为 ISO 8601 的日期,用以选择在该日期之后(或当天)创建的订单。
w
/************************************************************************
* OPTIONAL ON SOME INSTALLATIONS
*
* Set include path to root of library, relative to Samples directory.
* Only needed when running library from local directory.
* If library is installed in PHP include path, this is not needed
***********************************************************************/
set_include_path(get_include_path() . PATH_SEPARATOR . '../../.'); /************************************************************************
* OPTIONAL ON SOME INSTALLATIONS
*
* Autoload function is reponsible for loading classes of the library on demand
*
* NOTE: Only one __autoload function is allowed by PHP per each PHP installation,
* and this function may need to be replaced with individual require_once statements
* in case where other framework that define an __autoload already loaded.
*
* However, since this library follow common naming convention for PHP classes it
* may be possible to simply re-use an autoload mechanism defined by other frameworks
* (provided library is installed in the PHP include path), and so classes may just
* be loaded even when this function is removed
***********************************************************************/
function __autoload($className)
{
$filePath = str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php';
$includePaths = explode(PATH_SEPARATOR, get_include_path());
foreach ($includePaths as $includePath) {
if (file_exists($includePath . DIRECTORY_SEPARATOR . $filePath)) {
require_once $filePath;
return;
}
}
}
<?php
/**
* Escape special XML characters
* @return string with escaped XML characters
*/
function _escapeXML($str)
{
$from = array("&", "<", ">", "'", "\"");
$to = array("&", "<", ">", "'", """);
return str_replace($from, $to, $str);
} /**
* Determines if field is complex type
*
* @param string $fieldType field type name
*/
function _isComplexType($fieldType)
{
return preg_match("/^MarketplaceWebServiceOrders_/", $fieldType);
} /**
* Checks whether passed variable is an associative array
*
* @param mixed $var
* @return TRUE if passed variable is an associative array
*/
function _isAssociativeArray($var)
{
return is_array($var) && array_keys($var) !== range(0, sizeof($var) - 1);
} /**
* Checks whether passed variable is DOMElement
*
* @param mixed $var
* @return TRUE if passed variable is DOMElement
*/
function _isDOMElement($var)
{
return $var instanceof DOMElement;
} /**
* Checks whether passed variable is numeric array
*
* @param mixed $var
* @return TRUE if passed variable is an numeric array
*/
function _isNumericArray($var)
{
if (!is_array($var)) {
return false;
}
$sz = sizeof($var);
return ($sz === 0 || array_keys($var) === range(0, sizeof($var) - 1));
}
unique_mac_l = set([i['bssid'] for i in detail_data['signals']]) for i in unique_mac_l:
if i.find(':') == -1:
del unique_mac_l[unique_mac_l.index(i)]
s = '%s:%s:%s:%s:%s:%s' % (i[0:2], i[2:4], i[4:6], i[6:8], i[8:10], i[10:12])
unique_mac_l.append(s)
fun_action的更多相关文章
- C语言中使用类似awk的功能
awk实在是太强大了, 非常复杂的任务,几行代码就可以解决, awk经常需要用到, 但是在c语言里面, 调用system不太优雅, 能不能直接在c语言中直接调用呢,简单实现了一些功能, 但大多数情况, ...
随机推荐
- 180508 - 解决有关VIVO的2018-04-01安全补丁导致的APP闪退问题
解决有关VIVO的2018-04-01安全补丁导致的APP闪退问题 [√]问题原因猜测4: 最终解决方案 [√]问题原因猜测3: 尝试解决 [√成功] [×]问题原因猜测2: 尝试解决 [×失败] [ ...
- Event-Souring模式
Event-Sourcing模式使用仅附加存储来记录或描写叙述域中数据所採取的动作,从而记录完整的一系列系列事件,而不是仅存储实体的当前状态.由于存储包括全部的事件,能够用来具体化域对象. Event ...
- C++语言基础(24)-四种类型转换运算符(static_cast、dynamic_cast、const_cast和reinterpret_cast)
一.static_cast static_cast 只能用于良性转换,这样的转换风险较低,一般不会发生什么意外,如: #include <iostream> #include <cs ...
- WEEX快速入门
WEEX快速入门 WEEX 是阿里推送的一款基于Node.js,轻量级的移动端跨平台动态性技术解决方案,用于构建原生的速度的跨平台APP. 1. 搭建WEEX环境 1.1 首先下载安装Node.js, ...
- make命令用法--转
转自:http://www.techug.com/make 代码变成可执行文件,叫做编译(compile):先编译这个,还是先编译那个(即编译的安排),叫做构建(build). Make是最常用的构建 ...
- 如何查看VisualStudio的编译, 链接命令
VisualStudio默认是不显示编译命令的,如何查看呢. 对于链接器: 项目属性 -> 配置属性 -> 链接器 -> 常规 -> 显示进度 -> 设为 "/ ...
- PHP学习笔记(13)班级和学生管理---班级
两个文件夹,一个班级cls,一个学生stu. 两个表,一个班级cls,一个学生stu. 每个文件夹里有7个php文件:主界面cls.php-------增add.php,insert.php----- ...
- Model Binding is not working. MVC3 视图模型绑定不成功
问题出现在POST方法中,当我要将数据提交到后台的时候,绑定的变量值为null 原因是视图中的名称跟Controller中的视图的名称不一致造成的. 假如你视图中的Model采用的是Html.Labe ...
- poj3680 Intervals 区间k覆盖问题 最小费用最大流 建图巧妙
/** 题目:poj3680 Intervals 区间k覆盖问题 最小费用最大流 建图巧妙 链接:http://poj.org/problem?id=3680 题意:给定n个区间,每个区间(ai,bi ...
- 使用python进行新浪微博粉丝爬虫
由于最近没事在学python,正好最近也想趴下新浪微博上边的一些数据,在这里主要爬去的是一个人的粉丝具体信息(微博昵称,个人介绍,地址,通过什么方式进行关注),所以就学以致用,通过python来爬去微 ...