读取文件时有时候会遇到编码问题,导致读取的内容为乱码,此时我们可以用iconv来进行转码。 使用file_get_contents()来读取文件内容,但是有时候文件过大的话,就会导致内存溢出,读取失败, 此时使用逐行读取的方法; ...
分类:
其他好文 时间:
2018-09-12 19:59:52
阅读次数:
151
之前记得写过这2者的区别,今天看群里有个朋友也提出了怪异的问题,说是“file_get_contents('php://input')获取不到curl post请求的数据的问题”?其实这并不是所谓的"怪异",理解2者的区别其实就明白原因啦,好,直接举个例子吧,2个文件:1:发送数据的文件,如下: 2 ...
分类:
Web程序 时间:
2018-09-02 18:43:13
阅读次数:
212
//证书加密需要传的参数 字符串 证书地址 证书密码! function sign($data,$pfxpath,$pfxpwd) { $certs = array(); openssl_pkcs12_read(file_get_contents($pfxpath), $certs, $pfxpwd ...
分类:
Web程序 时间:
2018-08-27 10:28:41
阅读次数:
196
OpenSSLErrormessages:error:14090086:SSLroutines:ssl3_get_server_certific原因:cacert.pem证书失效,需要更新。参考:https://my.oschina.net/yearnfar/blog/346727https://curl.haxx.se/docs/caextract.html
分类:
Web程序 时间:
2018-08-24 11:47:36
阅读次数:
258
通过在文本中指定待替换的内容,如: 格式可以自己定义, 大概过程: 在文本中定义需要替换的文本内容; 以键值对的方式 组织数据(数组); 用 file_get_contents() 读取整个文件的内容; 再用 strtr() 替换内容。 ...
分类:
Web程序 时间:
2018-08-02 12:55:03
阅读次数:
233
html部分 php部分 原理是: 通过php获得api的地址获得数据,如果谁有可用的数据,请求分享 然后通过file_get_contents($url)获取url内容 php 两种方法获取url内容 file_get_contents和curl 然后通过ajax固定写法获取数据 txt是获得的数 ...
不要相信外部源 $_GET $_POST $_REQUEST $_COOKIE $argv php://stdin php://input file_get_contents() 远程数据库 远程api 来自客户端的数据 htmlentities htmlpurifier ...
分类:
Web程序 时间:
2018-07-17 23:24:32
阅读次数:
226
方法1: 用file_get_contents 以get方式获取内容: 方法2: 用fopen打开url, 以get方式获取内容: 方法3:用file_get_contents函数,以post方式获取url 方法4:用fsockopen函数打开url,以get方式获取完整的数据,包括header和b ...
分类:
Web程序 时间:
2018-06-30 14:49:14
阅读次数:
188
1 query("set names 'utf8'"); 14 $sql_array = preg_split("/;[\r\n]+/", file_get_contents($sqlfile)); 15 foreach ($sql_array as $k => $v) { 16 $result =... ...
分类:
数据库 时间:
2018-06-30 10:55:53
阅读次数:
172
<?phpinclude "flag.php";$a = @$_REQUEST['hello'];eval( "var_dump($a);");show_source(__FILE__); 文件包含 我们可以考虑让他输出flag.php 构造 hello=file_get_contents('fla ...
分类:
Web程序 时间:
2018-06-23 19:07:43
阅读次数:
198