<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf- Read More
posted @ 2012-12-27 22:13 tinyphp Views(579) Comments(0) Diggs(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 Read More
posted @ 2012-12-05 09:08 tinyphp Views(10728) Comments(0) Diggs(0)
sql Read More
posted @ 2012-12-03 10:56 tinyphp Views(254) Comments(0) Diggs(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) Read More
posted @ 2012-11-30 20:24 tinyphp Views(350) Comments(0) Diggs(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'"); $ Read More
posted @ 2012-11-28 21:10 tinyphp Views(524) Comments(0) Diggs(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< Read More
posted @ 2012-11-28 18:42 tinyphp Views(999) Comments(0) Diggs(0)
<?php$str=99.66;$zheng=explode(".",$str);echo $zheng[0];//整数部分99echo $zheng[1];//小数部分66?> Read More
posted @ 2012-11-07 16:39 tinyphp Views(815) Comments(0) Diggs(0)
表格图片预览:<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(1667) Comments(0) Diggs(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_ Read More
posted @ 2012-11-07 11:11 tinyphp Views(380) Comments(0) Diggs(0)
点击此处下载整个演示(包含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(3664) Comments(0) Diggs(0)