随笔分类 -  PHP

记录学习笔记
摘要:$arrprint_r之后是这样的:array('a'=>1,'b'=>2,'c'=>3,'d'=>4,'e'=>5); 怎么把它print_r之后的东西保存下来呢??变成$a="array('a'=>1,'b'=>2,'c'=>3,'d'=>4,'e'=>5);"解决方法:var_export()会一直保留着结构化形式存储数据.$a=var_export( 阅读全文
posted @ 2013-01-16 17:03 tinyphp 阅读(392) 评论(0) 推荐(0)
摘要:有没试过插入的数据无论是多少,都是会变成“2147483647”,因为你的值已经超过最大限度啦!int最大范围2147483647,换varchar吧!或者bigint 阅读全文
posted @ 2013-01-14 10:52 tinyphp 阅读(756) 评论(0) 推荐(0)
摘要:<?php$mystring = '激动的我啊';$findme = '激'; $pos = strpos($mystring, $findme); if ($pos === false){ echo '在'.$mystring.'中没有找到'.$findme; } else { echo '找到了'; }?>函数详情:http://www.w3school.com.cn/php/func_string_strpos.asp 阅读全文
posted @ 2012-12-05 09:08 tinyphp 阅读(10730) 评论(0) 推荐(0)
摘要:sql 阅读全文
posted @ 2012-12-03 10:56 tinyphp 阅读(255) 评论(0) 推荐(0)
摘要:如果标题只有:满100减50想把100和50抽离出来怎么办呢?<?php$s = '满100减50'; preg_match_all('/(\D+)(\d+)/', $s, $r); $t = array_combine($r[1], $r[2]); print_r($t); ?> 输出结果为,数字怎么改都没问题,短小精干,多用于优惠券系统:Array( [满] => 100 [减] => 50) 阅读全文
posted @ 2012-11-30 20:24 tinyphp 阅读(353) 评论(0) 推荐(0)
摘要:先准备一个excle:2009.xls 打开它另存为csv格式,一定是打开另存为!<?php header("Content-Type:text/html;charset=gbk"); $conn=mysql_connect('localhost','root','123456')or die("数据库连接失败"); mysql_select_db('test',$conn); mysql_query("SET NAMES 'GB2312'"); $ 阅读全文
posted @ 2012-11-28 21:10 tinyphp 阅读(525) 评论(0) 推荐(0)
摘要:<?phpheader("Content-type:application/vnd.ms-excel");header("Content-Disposition:attachment;filename=table.xls");?> <table border="1"> <tr> <td>t00</td><td>t01</td><td>t02</td> </tr> <tr> <td>t10< 阅读全文
posted @ 2012-11-28 18:42 tinyphp 阅读(1001) 评论(0) 推荐(0)
摘要:<?php$str=99.66;$zheng=explode(".",$str);echo $zheng[0];//整数部分99echo $zheng[1];//小数部分66?> 阅读全文
posted @ 2012-11-07 16:39 tinyphp 阅读(817) 评论(0) 推荐(0)
摘要:1 <h5 endtime="11/12/2012 16:00:00"></h5> 2 <input type="hidden" value="" id="servertime"/> 3 <script type="text/javascript" language="javascript"> 4 window.onload=function (){ 5 stime(); 6 } 7 var c=0; 8 <? date_ 阅读全文
posted @ 2012-11-07 11:11 tinyphp 阅读(383) 评论(0) 推荐(0)
摘要:很多时候我们需要导入的sql都很大,而且还会越来越大,这里讲解bigdump工具的使用方法:1.下载bigdump2.修改数据库配置你需要修改文件如下:$db_server=‘localhost’; //地址$db_name=”; //数据库$db_username=”; //用户名$db_password=”; //密码根据自己的实际情况进行修改。3.运行bigdump只需要通过浏览器访问bigdump.php文件就可以了,链接为http://xx/bigdump.php,选择sql文件的界面,如下图把bigdump.php和sql文件放根目录,或自己浏览选择然... 阅读全文
posted @ 2012-10-18 21:09 tinyphp 阅读(5726) 评论(0) 推荐(0)
摘要:第一次操作请先备份~第一步:httpd.conf文件 (在C:\AppServ\Apache2.2\conf)1、在apache配置文件(conf)httpd.conf里面找到#VirtualhostsIncludeconf/extra/httpd-vhosts.conf把这行的#去除,去除#说明开... 阅读全文
posted @ 2012-10-18 20:22 tinyphp 阅读(5650) 评论(0) 推荐(0)
摘要:1 <? 2 $arr=array(array('id'=>'1','name'=>'lily','start'=>'20110101','end'=>'20110103'), 3 array('id'=>'2','name'=>'may','start'=>'20110101','end'=>' 阅读全文
posted @ 2012-10-15 17:39 tinyphp 阅读(1158) 评论(0) 推荐(0)
摘要:<?php$arr=array(array('id'=>'1','name'=>'lily','start'=>'20110101','end'=>'20110103'),array('id'=>'2','name'=>'may','start'=>'20110101','end'=>'20110 阅读全文
posted @ 2012-10-15 17:35 tinyphp 阅读(588) 评论(0) 推荐(0)
摘要:unknow column ‘XXX’ in field list (找不到xxx这个属性或字段) 阅读全文
posted @ 2012-10-05 17:26 tinyphp 阅读(178) 评论(0) 推荐(0)
摘要:编辑器里的样式及类都自动清空了,上个版本不存在这个问题,默认只允许出现通过编辑器生成的标签! 像这样的代码: 读取的内容就会被过滤为: 解决的办法-加:KindEditor.options.filterMode = false; 如: 个人觉得它默认允许更方便用户。 官方详情: http://www 阅读全文
posted @ 2012-09-26 16:28 tinyphp 阅读(2969) 评论(0) 推荐(0)