随笔分类 -  PHP

摘要:转载自https://blog.csdn.net/fang_mu_mu/article/details/107370412 <?php/** * php 简单爬虫 * @todo snoopy.class\curl\file_get_contents采集类的用法 * */include('Snoop 阅读全文
posted @ 2021-05-31 10:24 2538 阅读(180) 评论(0) 推荐(0)
摘要:使用ajax与php后台交互。 下面是JQuery的ajax()与php交互的简单例子。 index.html代码 <!DOCTYPE html><html><head><meta charset="utf-8"> <!--利用cdn添加js和css库 --> <script src="https: 阅读全文
posted @ 2021-05-26 18:16 2538 阅读(397) 评论(0) 推荐(0)
摘要:<!-- token使用 --> <form action="2.php" method="POST"><?php $module=mt_rand(100000,999999);?><input type="text" name="sec_name" value=""/><input type="h 阅读全文
posted @ 2020-07-09 15:31 2538 阅读(258) 评论(0) 推荐(0)
摘要:转载自 https://www.cnblogs.com/magebiji/p/PHP_hanshu.html 一。PHP基础语法 变量,常量 严格区分大小写,但内置结构或关键字无所谓(echo) 命名:不能以数字,空格,.来开头,但是可以有汉字,eg:$变量="aa"; 可变变量:$a='aa';$ 阅读全文
posted @ 2019-12-12 14:04 2538 阅读(277) 评论(0) 推荐(0)
摘要:转载自 https://www.cnblogs.com/kenshinobiy/p/7783151.html $_FILES参数详解:$_FILES["file"]["name"] – 被上传文件的名称$_FILES["file"]["type"] – 被上传文件的类型$_FILES["file"] 阅读全文
posted @ 2019-12-12 13:57 2538 阅读(3291) 评论(0) 推荐(0)
摘要:转载原文地址为 https://www.cnblogs.com/bigvase/p/6647771.html 1.界定符 / 例:/[a]/ 匹配a 2.原子 unicode编码中最小的单元符号,即一个字符。原子又分为可见原子,和不可见原子。可见原子是指unicode编码表中可见的字符。不可见原子像 阅读全文
posted @ 2019-09-25 14:28 2538 阅读(2966) 评论(0) 推荐(0)
摘要:/// Tpl类 tpl.php <?php class Tpl{ /// 模板文件的路径 protected $viewDir='./view/'; /// 生成的缓存文件的路径 protected $cacheDir='./cache/'; /// 过期时间 protected $lifeTim 阅读全文
posted @ 2019-09-24 17:41 2538 阅读(586) 评论(0) 推荐(0)
摘要:<?php $config=include 'config.php'; $m=new Model($config); /// 调用这个函数时,要把数据表名写上去,写成常量的形式,要不然不执行var_dump($m->getByName('成龙')); /// 测试max函数/// var_dump( 阅读全文
posted @ 2019-09-23 13:56 2538 阅读(337) 评论(0) 推荐(0)
摘要:ob_get_contents() - 返回输出缓冲区的内容 ob_flush() - 冲刷出(送出)输出缓冲区中的内容 ob_clean() - 清空(擦掉)输出缓冲区 ob_end_flush() - 冲刷出(送出)输出缓冲区内容并关闭缓冲 ob_end_clean() - 清空(擦除)缓冲区并 阅读全文
posted @ 2019-09-20 17:38 2538 阅读(525) 评论(0) 推荐(0)
摘要:<?php $up=new Upload();$up->uploadFile('fm'); var_dump($up->errorNumber);var_dump($up->errorInfo); class Upload{ /// 文件上传保存路径 ////这里需要创建个文件夹,appserv下的 阅读全文
posted @ 2019-09-18 17:24 2538 阅读(226) 评论(0) 推荐(0)
摘要:<?php $page=new Page(5,60);var_dump($page->allUrl()); class Page{ ///每页显示多少条数据 protected $number; ///一共有多少条数据 protected $totalCount; ///当前页 protected 阅读全文
posted @ 2019-09-18 17:24 2538 阅读(217) 评论(0) 推荐(0)
摘要:<?php//// 验证码代码 $code = new Code();$code->outImage(); class Code { ///验证码个数 protected $number; ///验证码类型 protected $codeType; ///图形宽度 protected $width; 阅读全文
posted @ 2019-09-18 17:22 2538 阅读(1108) 评论(0) 推荐(0)
摘要:<?php $image=new Image();/// $image->water('0001.png','0002.png',9);//// 图片太大缩放代码用不了$image->suofang('0001.png',300,300);class Image{ /// 路径 protected 阅读全文
posted @ 2019-09-18 17:21 2538 阅读(254) 评论(0) 推荐(0)