删除指定文件夹所有文件
$cacheDir = '../cache/runtime';
$dh = opendir($cacheDir);
while ( $file = readdir($dh) ) {
删除指定文件夹所有文件
$cacheDir = '../cache/runtime';
$dh = opendir($cacheDir);
while ( $file = readdir($dh) ) {
因为复选框大多是几个同时存在的,我们都会name[]的名字必须是一个数组的 这样只要获取一个就可以了
html代码
substr() 函数返回字符串的一部分。
语法
例1
<?php
//密码验证
$password = "zongzi_Abc_oo13a2";
$n = preg_match_all("/^[a-zA-Zd_]{8,}$/",$password,$array);
//长度是8或更多
var_dump($array);
?>
如
<?php
$filename = "中文 文件名.txt";
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename=' . $filename);
print "Hello!";
?>
先利用trim系列函数来删除左右空格
<?php
mime_content_type返回指定文件的MIME类型,
用法:
PHP中常用的关键字
final
mkdir();函数
php创建文件夹和文件
phpmyadmin不能登录没有提示
解决方法:
<?php
$discuz_url = ‘http://localhost/klive/root/Discuz_X2.5_SC_GBK/’;//论坛地址
$login_url = $discuz_url .’member.php?mod=logging&action=login’;//登录页地址
flow.php
/* 添加赠品到购物车 */
foreach ($favourable['gift'] as $gift)
{
if (in_array($gift['id'], $_POST['gift']))
{
add_gift_to_cart($act_id, $gift['id'], $gift['price']);
}
}