-
PHP使用ob_start生成html页面的方法
[PHP教程] 2022-07-25 12:40:45 79人阅读
ob_start([string output_callback])- 打开输出缓冲区 所有的输出信息不在直接发送到浏览器,而是保存在输出缓冲区里面,可选得回调函数用于处理输出结果信息。 ob_end_flush - 结束(发送)输出缓冲区的内容,关闭...[详细]
-
最实用有效的PHP中防止SQL注入
[PHP教程] 2022-07-25 12:40:11 186人阅读
问题描述: 如果用户输入的数据在未经处理的情况下插入到一条SQL查询语句,那么应用将很可能遭受到SQL注入攻击,正如下面的例子: 因为用户的输入可能是这样的: 那么SQL查询将变成如下: 应该采取哪些有效的方法来...[详细]
-
php结合js实现点击超链接执行删除确认操作
[PHP教程] 2022-07-25 12:39:31 80人阅读
首先链接数据库,查询数据库数据: 代码如下: ?php $dbms=mysql; //数据库类型 ,对于开发者来说,使用不同的数据库,只要改这个,不用记住那么多的函数 $host=localhost; //数据库主机名 $dbName=db_database19; //...[详细]
-
php获取根域名方法汇总
[PHP教程] 2022-07-25 12:39:04 114人阅读
如果你只简单获取当前访问你页面的域名,我们只需要使用php中的函数HTTP_HOST就可以搞定了,如果是提取url根域名是需要正则的,下面就来看看几个具体实例。 如果是获取当前域名是非常的简单的: 代码如下: //获取当...[详细]
-
ruby中在终端命令行上调试grok表达式
[PHP教程] 2022-07-25 12:38:32 142人阅读
用 logstash 的人都知道在 http://grokdebug.herokuapp.com 上面调试 grok 正则表达式。现在问题来了:翻墙技术哪家强? 页面中用到了来自 google 域名的 js 文件,所以访问经常性失败。所以,在终端上通过命令行方式...[详细]
-
Github中自动测试工具 travis-ci的方法
[PHP教程] 2022-07-25 12:38:13 163人阅读
travis-ci. 它就是一个云端持续集成服务, 这个工具会在你每次 push 进行代码提交的时候, 进行代码的功能测试, 来运行 Perl 模块目录下 t/ 目录下的所有测试. 这个测试是会自动创建一个虚拟机, 并可以测试不同的 Perl...[详细]
-
php 无法上传大文件完美解决方案
[PHP教程] 2022-07-25 12:37:45 138人阅读
php.ini无法上传大文件完美解决办法 1、打开php.ini(打开方式就不用说了,百度一大堆) 2、查找post_max_size 表单提交最大数值,此项不是限制上传单个文件的大小,而是针对整个表单的提交数据进行限制的 默认为8M,设...[详细]
-
php cookie名使用点号句号会被转换
[PHP教程] 2022-07-25 12:37:28 175人阅读
这个标题不是很严格,应该说可以使用点号的cookie名,但会被转换,你命名一个cookie: $_COOKIE[my.name] = 1; 实际上你不能通过my.name在cookie中查找到这个值,只能是my_name: echo $_COOKIE[my_name]; php已经自动...[详细]
-
php格式化时间戳显示友好的时间实现思路及代码
[PHP教程] 2022-07-25 12:36:48 86人阅读
在项目中时间一律显示为2014-10-20 10:22显得很呆板。在微博、QQ空间等网站通常会显示为几秒前,几分钟前,几小时前等容易阅读的时间,我们称之为友好的时间格式。那么用php怎么实现呢? 大体思路如下: 如果是跨年并...[详细]
-
PHP中加密解密函数与DES加密解密实例
[PHP教程] 2022-07-25 12:35:49 68人阅读
例子,php加密解密的例子 加密函数: 代码如下:/* *功能:对字符串进行加密处理 *参数一:需要加密的内容 *参数二:密钥 */ function passport_encrypt($str,$key){ //加密函数 srand((double)microtime() * 1000000...[详细]
- 这篇文章主要介绍了Laravel 5.0 发布 新版本特性详解,...[详细]
- 计算两个日期之间的时间差需要先把两个日期转换成纪元...[详细]
- 初步使用面向对象程序设计,要掌握的就是使用面向对象...[详细]
- 每个 PHP 数组内部都有一个指针,该指针指向数组的某...[详细]
- 因为 PHP 是一个 Web 编程语言,在编程过程中难免会遇...[详细]
- PHP 中提供了 return 语句来返回函数的运行结果,其语...[详细]
- final 关键字的作用如下: 使用 final 修饰的类,不能...[详细]
- 在使用 switch 语句时应该注意以下几点: 和 if 语句...[详细]
- 这篇文章主要给大家介绍了关于PHP替换Word中变量并导...[详细]
- 这篇文章主要介绍了PHP常量DIRECTORY_SEPARATOR原理及...[详细]