随笔分类 -  PHP

摘要:效果图 html <tr> <td><label for="" class="control-label">支持协议:</label></td> <td><input type="text" class='my_input' name="agreement" id="agreement" /> </ 阅读全文
posted @ 2022-06-09 22:14 海乐学习 阅读(59) 评论(0) 推荐(0)
摘要:php用正常的ftp_get函数下载文件速度特别慢,但是用ftp的客户端下载很快,所以换了curl的下载方式,速度正常 function file_upload($ftpIp,$ftpUser,$ftpPwd,$path,$fileSavePath){ $curlobj = curl_init(); 阅读全文
posted @ 2022-05-06 14:23 海乐学习 阅读(435) 评论(0) 推荐(0)
摘要:在项目中要求用 Json的方式请求,并在 easyui-datagrid中实现分页。 easyui-datagrid 绑定方式 $('#grid').datagrid('options').url=url ; $('#grid').datagrid('options').queryParams=qu 阅读全文
posted @ 2021-03-09 16:53 海乐学习 阅读(949) 评论(0) 推荐(0)
摘要://参数 var params = {}; params['module'] = "ai"; params['action'] = "nextAiNode"; params['apiVersion'] = "1.0"; params['userId'] = ""; params['sessionId 阅读全文
posted @ 2021-02-20 12:35 海乐学习 阅读(221) 评论(0) 推荐(0)
摘要:javascript var arry = $("#fm").serializeArray(); // alert(arry); var url = 'Ajax-index.php?module=<{$module_name}>&action=DetailView_RecingToday_Save' 阅读全文
posted @ 2020-07-31 16:58 海乐学习 阅读(497) 评论(0) 推荐(0)
摘要:Smarty标签运算: 在页面上做简单的运算[temp5.html] 条件判断if 循环结构 for foreach用得比较多,foreach例子从数据库取出的数据 section功能和foreach类似,没foreach好理解 不推荐用 while temp5.html 阅读全文
posted @ 2018-01-27 21:56 海乐学习 阅读(593) 评论(0) 推荐(0)
摘要:$select="SELECT {$col_name} FROM woke_order where deleted=0 ".$where.$orderby ; // 取出数组 $rows=array(); $result=$db->query($select); while($row=$db->fe 阅读全文
posted @ 2018-01-27 21:29 海乐学习 阅读(158) 评论(0) 推荐(0)
摘要:GB2312 转换为 UTF-8 <?php $content = iconv('GB2312', 'UTF-8', $content); // $content为字符串 ?> iconv遇到不能识别的内容,会从第一个不能识别的字符开始截断,并生成一个E_NOTICE。因此后边的内容被丢弃了。 而在 阅读全文
posted @ 2017-05-09 16:26 海乐学习 阅读(193) 评论(0) 推荐(0)
摘要:1、在php.ini文件中改动error_reporting改为: error_reporting=E_ALL & ~E_NOTICE 2、如果你不能操作php.ini文件,你可以使用如下方法 在你想禁止notice错误提示的页面中加入如下代码: error_reporting(E_ALL^E_NO 阅读全文
posted @ 2017-02-16 15:35 海乐学习 阅读(17843) 评论(0) 推荐(0)
摘要:1.在php.ini中打开extension=php_oci8扩展,重启服务。 2.将php/ext目录下的php_oci8.dll文件拷贝到system32目录下 3.安装 Oracle9i客户端精简版 后重启电脑 配置: 查询: 插入: 阅读全文
posted @ 2016-08-17 16:30 海乐学习 阅读(27223) 评论(0) 推荐(0)
摘要:php 生成 Json 部分 <?php $arr_result = array(); //返回值 $arr_result['result'] = '0'; $arr_result['callerid'] = '139411288888'; echo json_encode($arr_result) 阅读全文
posted @ 2016-06-20 10:50 海乐学习 阅读(402) 评论(0) 推荐(0)
摘要:<?php header("Content-Type: application/msword"); header("Content-Disposition: attachment; filename=doc.doc"); //指定文件名称 header("Pragma: no-cache");hea 阅读全文
posted @ 2016-03-25 10:18 海乐学习 阅读(5774) 评论(0) 推荐(0)
摘要:$str="中国、美国、俄罗斯、德国、"$str=substr($str,0,-1);输出结果为:中国、美国、俄罗斯、德国 阅读全文
posted @ 2015-11-24 10:48 海乐学习 阅读(810) 评论(0) 推荐(0)
摘要:$t=1637544;$d=Sec2Time($t);$d为 0年18天 22小时52分24秒//将秒数转换为时间(年、天、小时、分、秒)function Sec2Time($time){ if(is_numeric($time)){ $value = array( "year... 阅读全文
posted @ 2015-05-06 16:39 海乐学习 阅读(24226) 评论(0) 推荐(0)
摘要://上一个月的今天格式为 "2014-09-23 10:05:09"$forward_month= GetMonth($sign="-1");//得到当前月的下一个月或上一个月的今天 function GetMonth($sign="-1") { //得到系统的日 $day_now=date("d"... 阅读全文
posted @ 2014-09-23 16:05 海乐学习 阅读(356) 评论(0) 推荐(0)
摘要:在PHP中进行GB2312与UTF-8的互换。GB2312--UTF-8iconv("GB2312","UTF-8",$text)UTF-8--GB2312iconv("UTF-8","GB2312",$text)conv函数把抓取来过的utf-8编码的页面转成gb2312,发现用iconv函数把抓取过来的数据一转码数据就会无缘无故的少一些。网上一查资料才知道这是iconv函数的一个bug。iconv在转换字符"—"到gb2312时会出错解决方法很简单,就是在需要转成的编码后加 "// 阅读全文
posted @ 2012-12-04 15:41 海乐学习 阅读(359) 评论(0) 推荐(0)
摘要:安装eaccelerator后的PHP 运行速度提高5-10倍,服务器资源(cpu/内存等)占用减少30-60% 安装步骤:1、把 DLL文件放入 php\ext 下2、php安装目录下 新建 temp 文件夹 设置可写入权限3、php.ini 最后结尾部分加入以下代码 [eaccelerator] 阅读全文
posted @ 2011-11-25 23:26 海乐学习 阅读(1157) 评论(0) 推荐(0)
摘要:php 动态生成多选按钮<?phpfunction generate_checkboxes($name,$options, $default=array()) { if (!is_array($default)){ $default = array(); } foreach($options as $value => $label) { $html .= "<input type=checkbox "; if (in_array($value, $default)){ $html .= "checked "; } $html .= &q 阅读全文
posted @ 2011-09-16 16:09 海乐学习 阅读(1764) 评论(0) 推荐(0)
摘要:Xdebug 使用说明先说下配置方法:1 下载xdebug http://www.xdebug.org 下载wincachegrind: http://sourceforge.net/projects/wincachegrind/ wincachegridd:为xdebug输出文件分析工具2 把xdebug copy到php扩展文件目录:d:/wamp/bin/php/php5.2.5/ext/编辑php.ini ,在其中添加如下配置行:Php代码 zend_extension_ts="d:/wamp/bin/php/php5.2.5/ext/xdebug.dll" ;;; 阅读全文
posted @ 2011-03-29 10:26 海乐学习 阅读(2080) 评论(0) 推荐(0)
摘要:<?php $aera_p="上海,海南,北京,重庆,四川";$aa=explode(",",$aera_p); //explode() 函数把字符串分割为数组//$aa=split("[,]",$aera_p); //截取以","为准的字符串,slipt为用正则表达式判断$BRCount = substr_count($aera_p, ','); //计算","为多少个for($i=0;$... 阅读全文
posted @ 2010-10-20 10:22 海乐学习 阅读(288) 评论(0) 推荐(0)