悉野小楼

导航

随笔分类 -  php

php内容
几种语言实现hmac_sha256签名方法
摘要:php: function php_hmac_sha256($secret, $message) { $hmac = hash_hmac('sha256', $message, $secret); return $hmac; } java: /** * 使用HMAC-SHA256算法生成签名 * * 阅读全文

posted @ 2025-04-24 11:09 悉野 阅读(115) 评论(0) 推荐(0)

记录一次PhpStorm配置XDebug
摘要:PhpStorm 2023.2.3 + php5.6 参考:PHPStorm官方, PhpStorm配置Xdebug(超详细), xdebug下载与配置,有这一篇就够了 1.到官网下载 xdebug dll, 因为我用的是php 5.6的, 所以要下载历史版本的dll https://xdebug. 阅读全文

posted @ 2023-11-16 11:58 悉野 阅读(202) 评论(0) 推荐(0)

php服务生成exe附件下载
摘要:php附件多3个字节问题, 保存的php文件, 要选择utf-8无bom格式, 如果php文件有bom, 生成的exe也会有bom 阅读全文

posted @ 2016-12-21 17:33 悉野 阅读(868) 评论(0) 推荐(0)

php SimpleXML 例子
摘要:$txt = GetRemoteText($url); if(strlen($txt) > 0) { $xml = simplexml_load_string($txt); //获取xml if($xml) { $logo = $xml->xpath("webinfo"); $title = $xm 阅读全文

posted @ 2016-11-24 17:34 悉野 阅读(464) 评论(0) 推荐(0)

php utf-8字符转ascii字符
摘要:function utf8_urldecode($str) { $str = preg_replace("/%u([0-9a-f]{3,4})/i","&#x\\1;",urldecode($str)); return html_entity_decode($str,null,'UTF-8');; 阅读全文

posted @ 2016-11-24 17:30 悉野 阅读(3390) 评论(0) 推荐(0)

php简单的抓取
摘要:php抓取当前页面中所有链接,再分析下载想要下载的链接,保存到数据库代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--<?PHP//GETalllinksfromURLfunctionremove_html_tags(&$item,$k... 阅读全文

posted @ 2010-06-27 21:40 悉野 阅读(222) 评论(0) 推荐(0)

php生成的html meta和link标记在body标签里 浏览器顶部有个空行
摘要:1.php中用smarty模板生成的html在浏览器中顶部有一空行.2.用firedebug发现 meta和link标记在body标签里.本机上wmap运行没事, 送到远程服务器上是IASP的服务, 会出现上述bug.看了下源文件, 文本一样的. 但保存时提示编码问题.估计是utf-8问题了.在网上找了下, 是utf-8 BOM问题.解决方法: 用UltraEdit32把smarty模板文件即引用... 阅读全文

posted @ 2010-05-16 18:03 悉野 阅读(800) 评论(0) 推荐(0)