$handle=fopen('test.html','w');if(fwrite($handle,'helloworld.2018')>0){fclose($handle);echo"写入成功";}else{echo"写入失败,请稍后再试";}
原创
2018-04-02 12:52:35
706阅读
2评论
方法一:$re = file_get_contents($url);print_r($re);方法二:$ch = curl_init("http://www.jb51.net/") ; curl_setopt($ch, CURLOPT_RETURNTRANSFER, true) ; curl_set...
原创
2022-05-31 15:11:49
500阅读
$json = 'json'; $url = 'http://192.168.1.162:18888/php-crud-api-master/api2.php/categories'; $post_data['name'] = $json; $res = request_post($url, $post_data); print_r($res);
原创
2021-07-13 14:42:10
179阅读
前面整理过一篇文章,描述php中的array与json的array和object的转换关系。 在实际开发中,如何保障这种关系呢?一般来说,需要定义一些类型来做映射。 废话不多说,上
转载
2016-12-03 16:45:00
162阅读
2评论
PHP模拟链表操作 一、总结 1、类成员用的是-> 2、对象节点相连的话,因为是对象,所以不用取地址符号 3、数组传递参数的时候传引用的方法 ,& 二、PHP模拟链表操作 代码一: 代码2:
转载
2018-05-08 21:50:00
42阅读
http://phperwuhan.blog.163.com/blog/static/41142602201201935033938/
原创
2015-10-13 13:15:05
479阅读
$json = 'json'; $url = 'http://192.168.1.162:18888/php-crud-api-master/api2.php/categories'; $post_data['name'] = $json; $res = request_post($url, $post_data); print_r($res);
原创
2022-02-28 11:24:32
92阅读
1.7 模拟方法重载通过魔术方法模拟方法重载<?phpclass Math { public function __call($fn_name,$fn_args) { $sum=0; foreach($fn_args as $v) { $sum+=$v; } echo implode(',',$fn_args).'的和是:'.$sum,'<br>'...
原创
2021-08-17 16:44:58
99阅读
读取数据库,显示数据foreach($s as $ss){echo '同步中 ...';for( $i = 1 ; $i '; echo $ss['people']; echo ""; flush(); ob_flush(); sleep(1);}echo 'End ....
转载
2014-12-24 14:20:00
76阅读
/** * 模拟表单提交 * @param $url 字符串/必填 例子:https://xxxxx/singleQueryRequest.do * @param $data array$headers = array('Content-Type: applicat...
原创
2022-07-19 17:39:01
466阅读
canvas时钟模拟器主要功能能够显示当前的时间,也能够切换夜晚模式和白天模式主要代码h = h > 12 ? h : h - 12 // 下午时间修正// 如果画布状态很混沌的话多使用ctx.restore()恢复到最初状态而不要强行再用同样的方法矫正状态,比如使用rotate顺时针旋转n度之后,再使用rotate以同样的逆时针角度转回去.参考代码<!DOCTYPE html>
转载
2024-09-30 14:50:58
67阅读
PHP时间函数
PHP中的时间函数有这么些:
(1)date
用法: date(格式,[时间]);
如果没有时间参数,则使用当前时间. 格式是一个字符串,其中以下字符有特殊意义:
U 替换成从一个起始时间(好象是1970年1月1日)以来的秒数
Y 替换成4位的年号.
y 替换成2位的年号.
F 替换成月份的英文全称.
M 替换成月份的英文简称.
m 替换成月份
转载
精选
2011-10-26 09:03:08
418阅读
1. php在当前日期增加一天 2.当前时间减去2小时 3. 获取数据库日期减一天。 4. 5. 今天的开始和结束时间
转载
2017-06-30 19:01:00
89阅读
//strtotime 时间转为时间戳 /** * @param $actionTime * @param $endTime */ function demo($actionTime,$endTime){ if (strtotime($endTime) < strtotime($actionTime ...
转载
2021-09-07 22:52:00
82阅读
2评论
PHP时间戳UNIX 时间戳(timestamp)是 PHP 中关于时间日期一个很重
原创
2022-08-28 00:14:52
1474阅读
curl 模拟提交
原创
2014-01-10 13:59:25
446阅读
一个比较好的类:$cookie_file=tempnam("C:/users","tmp");生成以以tmp为前缀的文件。<?phpdefine ( 'IS_PROXY', true ); //是否启用代理/* cookie文件 */$cookie_file = dirname ( __FILE__ ) . "/cookie_" . md5 ( basename ( __FILE__ ) )
转载
2014-02-20 20:53:00
129阅读
2评论
关键字:CURL Cookie CURLOPT_COOKIEJAR CURLOPT_COOKIEFILE 模拟登录 PHP作者:方倍工作室原文:http://www.cnblogs.com/txw1958/p/php-cookie-login.html 一、定义Cookie存储路径 必须使用绝...
转载
2013-12-24 16:00:00
273阅读
1.7 模拟方法重载
通过魔术方法模拟方法重载
<?php
class Math {
public function __call($fn_name,$fn_args) {
$sum=0;
foreach($fn_args as $v) {
$sum+=$v;
}
echo implode(',',$fn_args).'的和是:'.$sum,'<br>'...
原创
2022-03-03 14:07:03
61阅读
url,post,cookie。 有这三种就可以了。 下面使用Postman模拟发送。 其中,body中是post参数,header中是cookie数据。 下面是php模拟代码。 下面写一个定时任务! 下面是doGet
原创
2021-08-05 15:33:17
181阅读