摘要:
作为最流行的服务端语言PHP(PHP: Hypertext Preprocessor),在开发API方面,是很简单且极具优势的这篇文章写给不太了解PHP开发API接口的开发者一、先简单回答两个问题1、PHP 可以开发客户端吗?答:正确的回答是,不适合,因为PHP是服务端脚本语言,负责 B/S或C/S 阅读全文
摘要:
function get_files($path, $absolute=1) { $files = array(); $_path = realpath($path); if (!file_exists($_path)) return false; if (is_dir($_path)) { $li 阅读全文
摘要:
函数注释: // $string: 明文 或 密文 // $operation:DECODE表示解密,其它表示加密 // $key: 密匙 // $expiry:密文有效期 function authcode($string, $operation = 'DECODE', $key = '', $e 阅读全文
摘要:
一个简单的php获取远程文件内容的函数代码,兼容性强。直接调用就可以轻松获取远程文件的内容,使用这个函数也可获取图片。代码如下: ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 阅读全文
摘要:
function file_type($file) { $filepath = realpath($file); $filetype = array( 7790=>'exe', 7784=>'midi', 8075=>'zip', 8297=>'rar', 7173=>'gif', 6677=>'b 阅读全文
摘要:
header("Content-Type: application/octet-stream; charset=utf8"); header("Content-Disposition: attachment; filename=倒流博客.url"); $shortcut = array( '[Int 阅读全文
摘要:
PHP脚本是按文档流的形式来执行的,所以我们在编写PHP程序时,代码基本都是串行的,尤其是SQL,比如:<ignore_js_op> 这种方式,是每次查询都需要等待结果返回之后再开始下一次的查询,运行时间 = (第1次发送请求时间 + 0.01 + 第1次返回时间)+(第2次发送请求时间 + 0.0 阅读全文
摘要:
<?php $module = $_GET['module']; $action = $_GET['action']; $token = md5sum($module.date('Y-m-d',time()).'#$@%!*'.$action); if($token != $_GET['token' 阅读全文
摘要:
本文实例讲述了PHP使用token防止表单重复提交的方法。分享给大家供大家参考,具体如下: ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 <?php /* * PHP使用to 阅读全文