
php 函数的使用
爱因斯坦小弟
我们不生产代码,只是代码的搬运工
展开
-
file_get_contents 的使用
1,使用file_get_contents函数请求链接不会跳到请求的链接 return file_get_contents($url.'?'.$get);//$url是你要请求的连接,$get是你请求传过去的数据原创 2017-07-07 09:32:38 · 606 阅读 · 0 评论 -
php 连接ftp 的上传下载
/** * host 服务器IP或者域名 必填 * port 端口 选填,规定 FTP 服务器的端口。默认是 21。 * timeout 可选。规定该 FTP 连接的超时时间。默认是 90 秒。 * ftp_connect(host,port,timeout) */$conn = ftp_connect('192.168.1.4') or die("Could not conn...原创 2018-11-05 11:27:50 · 454 阅读 · 0 评论 -
在字符串中查找是否存在某个字符
<?phpheader("content-type:text/html;charset=utf-8");$str = 'WTO';function readTxt(){ # code... $handle = fopen("./test.txt", 'rb'); while (feof($handle)===false) { # code...原创 2018-11-15 12:16:28 · 2984 阅读 · 0 评论 -
无限分类引用写法
首先我们会获取一个数组$list = array( array('id'=>1, 'fid'=>0, 'title' => '中国'), array('id'=>2, 'fid'=>1, 'title' => '江苏'), array('id'=>3, 'fid'=>1, 'title' =>...原创 2018-11-20 11:46:55 · 554 阅读 · 0 评论 -
PHP 转义字符转为HTML标签
1.使用PHP原生自带的方法htmlspecialchars_decode() htmlspecialchars_decode($str) // $str 是要转义的字符2. js直接转义function escape2Html(str) { let arrEntities = {'lt': '<', 'gt': '>', 'nbsp': ' ...原创 2019-03-07 10:23:00 · 3877 阅读 · 1 评论 -
PHP 常用数组函数
1.array_combine()生成一个数组,用一个数组的值作为键名,另一个数组值作为值;如: $a1=array("a","b","c","d"); $a2=array("Cat","Dog","Horse","Cow"); print_r(array_combine($a1,$a2)); 打印:Array ( [a] =&g...原创 2019-04-16 15:14:43 · 261 阅读 · 0 评论