Home > Backend Development > PHP Tutorial > 一些常用的php简单命令代码集锦_php技巧

一些常用的php简单命令代码集锦_php技巧

WBOY
Release: 2016-05-17 09:38:59
Original
838 people have browsed it

删建:
 引用
if(file_exists("file.htm"))// 检查是否存在此文件
if(file_exists("chat"))//检查是否存在此文件夹
rename('index.php','index'); //将index.php 改名为 index
fopen("name.php","a+"); //建立文件
mkdir("boot","0777"); //建立文件夹且设置属性为777
rmdir ("include");//删除文件夹
unlink("index.php");//删除文件 

数据库的查询:
 引用
$db = new db_query;
$db->connect();
$db->query("DROP DATABASE $DbName;");//$dbname 为数据库名

连接:
 引用
header("location:index.php");//转到网页
echo "第二步:请选择是否删除所有文件[聊天室]
";//写出代码
unset($tmp); //清除原有缓存
require("global.php");//缓存
print eot;

Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template