随笔分类 -  PHP

在Windows下为PHP安装redis扩展
摘要:1.使用phpinfo()函数查看PHP的版本信息,这会决定扩展文件版本 2.选择http://windows.php.net/downloads/pecl/snaps/redis/2.2.5/ http://windows.php.net/downloads/pecl/releases/igbin 阅读全文
posted @ 2017-04-01 16:30 上善若水-随 阅读(227) 评论(0) 推荐(0)
PHP 的 HTTP 认证机制
摘要:PHP 的 HTTP 认证机制仅在 PHP 以 Apache 模块方式运行时才有效,因此该功能不适用于 CGI 版本。在 Apache 模块的 PHP 脚本中,可以用 header()函数来向客户端浏览器发送"Authentication Required"信息,使其弹出一个用户名/密码输入窗口。当 阅读全文
posted @ 2017-03-27 10:51 上善若水-随 阅读(1531) 评论(0) 推荐(0)
PHP获取站点根目录
摘要:最简单方式:$_SERVER['DOCUMENT_ROOT'],暴力通俗易懂,网站根目录,GG. 将下面的代码放在网站根目录下的一个文件中,以便在其它文件中引用。 路径方式: define('BASE_PATH',str_replace('\\','/',realpath(dirname(__FIL 阅读全文
posted @ 2017-03-25 10:41 上善若水-随 阅读(79892) 评论(0) 推荐(1)
数据库中的左连接(left join)和右连接(right join)区别
摘要:Left Join / Right Join /inner join相关关于左连接和右连接总结性的一句话:左连接where只影向右表,右连接where只影响左表。Left Joinselect * from tbl1 Left Join tbl2 where tbl1.ID = tbl2.ID左连接 阅读全文
posted @ 2017-03-21 15:21 上善若水-随 阅读(122425) 评论(0) 推荐(7)
php中点击网页不跳转执行程序
摘要:if($code['result_code'] !='FAIL') { echo ""; //echo "退款成功"; ; }else{ echo ""; } 阅读全文
posted @ 2017-02-14 17:34 上善若水-随 阅读(2802) 评论(0) 推荐(0)
curl常用功能
摘要:1 'beauty', "upload"=>"@a.zip"); 14 curl_setopt($ch, CURLOPT_POST, 1); 15 curl_setopt($ch, CURLOPT_POSTFIELDS, $data); 16 //**************************************************************************... 阅读全文
posted @ 2017-01-08 16:41 上善若水-随 阅读(999) 评论(0) 推荐(0)
PHP 页面编码声明方法详解(header或meta)
摘要:2 php的header来定义一个php页面为utf编码或GBK编码 3 4 php页面为utf编码 5 header("Content-type: text/html; charset=utf-8"); 6 7 php页面为gbk编码 8 header("Content-type: text/html; charset=gb2312"); 9 10 php页面为... 阅读全文
posted @ 2017-01-08 08:12 上善若水-随 阅读(9150) 评论(0) 推荐(0)
php变量与数组相互转换的方法(extract与compact
摘要:1 #php变量与数组相互转换的方法(extract与compact) 2 3 #compact 多个变量转数组 4 $name = 'sui'; 5 $email = 'sui@qq.com'; 6 $arr = compact('name','email'); 7 print_r($arr); 8 9 #extract 数组转多个变量 10 //数组转多个变量 11 $... 阅读全文
posted @ 2017-01-08 08:07 上善若水-随 阅读(4063) 评论(0) 推荐(0)
PHP多条件搜索ShopNc实例
摘要:控制器部分代码: 模板账号: 阅读全文
posted @ 2016-12-19 09:47 上善若水-随 阅读(823) 评论(0) 推荐(0)
file_put_contents保存数据,
摘要:file_put_contents("sui.txt", var_export($now_member,TRUE),FILE_APPEND); 可以保存数组,方便调试 阅读全文
posted @ 2016-12-13 17:12 上善若水-随 阅读(234) 评论(0) 推荐(0)
PHP中多态,抽象类,接口,
摘要:小例子: 需求:公司定义一个接口让我们开发功能 usb.interface.php: store.class.php: mouse.class.php: key.class.php: 使用:computer.class.php 阅读全文
posted @ 2016-11-02 19:16 上善若水-随 阅读(362) 评论(0) 推荐(0)
PHPMySQL 中 pdo文件的增删改查
摘要:1 query('select user_name,user_id,email from dsc_admin_user') as $v) { 9 print_r($v['user_name'].'~~~~~~~~~~~~~~~~~'.$v['email']); 10 echo ""; 11 }*/ 12 13 /*$sql = "insert... 阅读全文
posted @ 2016-11-01 11:13 上善若水-随 阅读(1366) 评论(0) 推荐(0)