http://php.net/manual/wrappers.php

过程:

1. 开始通信

2. 读取数据

3. 写入数据

4. 结束通信

usage:

* 读写文件系统

<?php
$handle = fopen('file:///etc/hosts', 'rb');
while (feof($handle) !== true) {
echo fgets($handle);
}
fclose($handle);

  

##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
127.0.0.1 bogon # added by Apache Friends XAMPP
192.168.10.10 homestead.test
192.168.10.10 homestead.app
192.168.10.127 mingzhanghui

/etc/hosts

* 通过HTTP、HTTPS、ssh与远程web服务器通信

<?php
$json = file_get_contents(
'https://www.hao123.com/api/tnwhilte?tn=93082360_s_hao_pg'
); $a = json_decode($json, true);
var_dump($a);

  

array(4) {
   ["errno"]=> int(0)
   ["ft"]    =>  string(75) "UWYknj0krj6sn7qCmyqxTAThIjYkPHnznWm1rjTzP1DYFhnqpA7EnHc1Fh7W5HD4n1m4nj63Pjb"
   ["fake"]=>  int(1)
   ["tn"]  =>   string(15) "10018800_hao_pg"
}

* 打开并读写zip、rar、phar压缩文件

PHP博客链接

http://www.cnblogs.com/52fhy/category/604746.html

最新文章

  1. ABP文档 - 后台作业和工作者
  2. extJs学习基础5 理解mvvm的一个小案例
  3. Javascript事件冒泡机制
  4. 关于https的Error:Error Domain=NSURLErrorDomain Code=-1012
  5. 【转】MySQL中增加sequence管理功能(模拟创建sequence)
  6. hihoCoder太阁最新面经算法竞赛17
  7. iOS程序进入后台后仍运行定时器NSTimer
  8. git删除远程分支和本地分支
  9. Jquery 弹出新窗体
  10. iOS改变图片尺寸
  11. 1005 Jugs
  12. error U1087: cannot have : and :: dependents for same target
  13. Web静态和动态项目委托代理基于面向方面编程AOP
  14. 【.net 深呼吸】自定义应用程序配置节
  15. Android简易实战教程--第四十八话《Android - Timer、TimerTask和Handler实现倒计时》
  16. 关于thinkphp5手动抛出Http异常时自定义404页面报错的问题
  17. spring+springmvc+hibernate 框架搭建
  18. C# 显式转换关键字 explicit
  19. Activiti 用户手册
  20. Oracle中PL/SQL的循环语句

热门文章

  1. 说说XXE漏洞那些事
  2. shodan搜索
  3. 冰蝎&amp;哥斯拉 流量特征分析
  4. DHCP服务-自动管理IP地址和分配固定IP
  5. Abp vNext 基础篇丨领域构建
  6. SpringBoot中实现支付宝支付
  7. Ladp存储规则
  8. docker部署elasticsearch-+-Kibana(6-8)-+-SpringBoot-2-1-6
  9. springboot整合多数据源解决分布式事务
  10. 【springboot】自动装配原理