<?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 Read More
posted @ 2012-12-05 09:08 tinyphp Views(10724) Comments(0) Diggs(0) Edit
sql Read More
posted @ 2012-12-03 10:56 tinyphp Views(249) Comments(0) Diggs(0) Edit
如果标题只有:满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) Read More
posted @ 2012-11-30 20:24 tinyphp Views(347) Comments(0) Diggs(0) Edit
先准备一个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'"); $ Read More
posted @ 2012-11-28 21:10 tinyphp Views(517) Comments(0) Diggs(0) Edit
<?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< Read More
posted @ 2012-11-28 18:42 tinyphp Views(994) Comments(0) Diggs(0) Edit
<?php$str=99.66;$zheng=explode(".",$str);echo $zheng[0];//整数部分99echo $zheng[1];//小数部分66?> Read More
posted @ 2012-11-07 16:39 tinyphp Views(800) Comments(0) Diggs(0) Edit
表格图片预览:<div class="buss"><table> <tbody> <tr> <th class="fir">活动类型</th><th>9.9包邮(秒杀)</th><th>20元封顶</th><th>暗号团</th><th>独家折扣</th> </tr> <tr> <td class="fir">活动价格</td& Read More
posted @ 2012-11-07 16:12 tinyphp Views(1660) Comments(0) Diggs(0) Edit
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_ Read More
posted @ 2012-11-07 11:11 tinyphp Views(377) Comments(0) Diggs(0) Edit
点击此处下载整个演示(包含html的演示与php的演示)默认效果:鼠标移上:点击后,状态不变:核心代码: 1 <script type="text/javascript"> 2 $(function(){ 3 $('.open').click(function(){if($(this).attr('class')=='open'){$('#b'+$(this).attr("id").replace('a_','')).animate({height Read More
posted @ 2012-10-22 11:23 tinyphp Views(3658) Comments(0) Diggs(0) Edit
很多时候我们需要导入的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文件放根目录,或自己浏览选择然... Read More
posted @ 2012-10-18 21:09 tinyphp Views(5695) Comments(0) Diggs(0) Edit