方法二
//中文截取2,单字节截取模式
//如果是request的内容,必须使用这个函数
方法二
//中文截取2,单字节截取模式
//如果是request的内容,必须使用这个函数
require_once './includes/reader.php';
// excelfile($filename, $encoding);
$data = new spreadsheet_excel_reader();
// set output encoding.
$data->setoutputencoding('gbk');
//"data.xls"是指要导入到mysql中(的)excel文件
$data->read('date.xls');
@ $db = mysql_connect('localhost', 'root', '1234') or
die("could not connect to database.");//连接数据库
mysql_query("set names 'gbk'");//输出中文
mysql_select_db('wenhuaedu'); //选择数据库
error_reporting(e_all ^ e_notice);
for ($i = 1; $i <= $data->sheets[0]['numrows']; $i++) {
//以下注释(的)for循环打印excel表数据
for ($j = 1; $j <= $data->sheets[0]['numcols']; $j++) {
echo $data->sheets[0]['cells'][$i][$j].",";
}
echo "n";
$filename = 'cachefile.php';
$str ='echo "bb";';
if( is_file( $filename ) )
{
$tmp = readcache( $filename ) ;
}
else
{
createcache( $filename,$str );
}
$q ='www.phprm.com';
$items = array(
"great <em>bittern</em>"=>"botaurus stellaris",
"little <em>grebe</em>"=>"tachybaptus ruficollis",
"black-necked grebe"=>"podiceps教程 nigricollis",
"little bittern"=>"ixobrychus minutus",
"black-crowned night heron"=>"http://www.phprm.com",
"www.phprm.com"=>"ardea purpurea",
"white stork"=>"ciconia ciconia",
"spoonbill"=>"platalea leucorodia",
"red-crested pochard"=>"netta rufina",
"common eider"=>"somateria mollissima",
"red kite"=>"milvus milvus",
"hen harrier"=>"circus cyaneus",
"heuglin's gull"=>"larus heuglini"
);
foreach ($items as $key=>$value) {
if (strpos(strtolower($key), $q) !== false) {
echo "$key|$value ";
}
}
//js 电话号码正则表达式
function mysubstr( $str, $length ){
$tagcnt = 0;
$charcnt = 0;
$tag = '';
$maxlen = strlen( $str );
$resultstr = '';
$tagstack = array();
<html><heae>
<title>php教程读取excel并查询指定数据</title>
<body><center>成绩查询系统<hr>
<table border=0><tr>
<td bgcolor=red align=center)成绩查询系统输入界面</td>
<td bgcolor=tintyellow align=left rowspan=2>说明 :<br>
请输入正确且完整的数据.<br>
本查询系统仅供参考,实际以成绩单为准.<br>
例如:查询 2001 学年第一学期二专资管科一年级一班<br>
学号输入格式范例:c017037<br>
<br></td><tr>
<td bgcolor=tintblue align=center><center><form action=nscore.php method=get>
<select name=pl>
<option value=2001>2001
<option value=2002>2002
<option value=2003>2003
<option value=2004>2004
</select)学年第
<select name=p2>
<option value=1>一
<option value=2>二
</select>学期<br>
<select name=p3>
<option value=1>二专
<option value=2>二技
<option value=3>四技
</select>学制
<select name=p4>
<option value=1>电子
<option value=2>电机
<option value=3>机械
<option value=4>土木
<option value=5>经管
<option value=6>环工
<option value=7>资管
<option value=8>应外
</select>系/科
<select name=p5>
<option value=1>一
<option value=2>二
<option value=3>三
</select>年级
<select name=p6>
<option value=1>一
<option value=2>二
<option value=3>三
<option value=4>四
</select>班<br>
<b>学号:</b><input size=10 name=no><br><br>
<input type=submit value=确定 name=submit>
</form>
</center></td>
</tr>
</table>
<hr>
</body></html>
<html><title)服务器运行状况即时显示表</title>
<table border=0><tr><td bgcolor=litered width=100% colspan="9"><p align="center"><b>服务器运行状况即时显示表</b><center>
<?php教程
set_time_limit(0);
echo strftime ("%y 年 %m 月 %d 日. ");
?>
</td></tr>
<tr><td bgcolor="#cococo">ip 地址</td><td bgcolor="#cococo">检测时间</td>
<td bgcolor="#cococo">ftp </td>
<td bgcolor="#cococo">telnet</td><td bgcolor="#cococo">smtp </td>
<td bgcolor="#cococo">dns</td><td bgcolor="#cococo">http </td>
<td bgcolor="cococo">pop3</td><td bgcolor="#cococo">finger </td>
</td></center>
//实例一
//实例二
//日期实例二
?>