1.关于用文本php做简单的网页,给个示范
<html>
<head>
<meta ; charset=utf-8">
<title>;无标题文档</title>
</head>
<body>
<?php echo "hello word";?>
</body>
</html>
2.用php中sql建数据库和表我有一张表格(word),想用php
下个开源免费的数据库mysql安装程序 和客户端;然后再使用SQL建库,或者就直接使用test数据库接着创建表、建表结构CREATE TABLE 的语法是: CREATE TABLE "表格名"("栏位 1" "栏位 1 资料种类","栏位 2" "栏位 2 资料种类",。
) 若我们要建立顾客表格,我们就打入以下的 SQL: CREATE TABLE customer(First_Name char(50),Last_Name char(50),Address char(50),City char(50),Country char(25),Birth_Date date) 其他的SQL可以参考/cn/sql-create。php。
3.PHP 用PHPExcel往数据库导入大量数据
1、首先我们准备一个含有数据的Excel表格,表头和数据表中的表字段相对应。
2、在ThinkPHP中引入PHPExcel类库。
3、然后我们编写导入的PHP代码。
4、然后我们编写导出的PHP代码。
5、然后我们进行导出测试发现可以导出即可。
4.php 怎么实现文件的对比
一段demo代码:
$file1 = file_get_contents("./1.txt");
$file2 = file_get_contents("./2.txt");
$arr1 = preg_split("/\n/",$file1);
$arr2 = preg_split("/\n/",$file2);
foreach($arr1 as $index => $v)
{
if($v != $arr2[$index])
{
//两个字符串不匹配,做飘红逻辑,比如添加color标签
}
}
转载请注明出处51数据库 » 用php展示word