举例 URL : http://www.phprm.com/Test/Test.php
$_SERVER['SERVER_NAME']: www.111cn.net
举例 URL : http://www.phprm.com/Test/Test.php
$_SERVER['SERVER_NAME']: www.111cn.net
1. 截取GB2312中文字符串
<?php
<?php
class listdir{
var $depth;
var $dirname;
var $list;
var $tostring;
function listdir($dir){
$this->dirname=$dir;
$this->depth=0;
$this->tostring=”";
}
关于用PHP如何实现全站静态化处理的内容,这样让php生成HTML纯静态网页,让访问速度更快。
手机(中国移动手机号码):
验证是否为手机号码的正则
如
<?php
$filename = "中文 文件名.txt";
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename=' . $filename);
print "Hello!";
?>
例1
function my_array_unique($array2D){
foreach ($array2D as $v){
$v = implode(“,”,$v);
$temp[] = $v;
}
$temp = array_unique($temp);
foreach ($temp as $k => $v){
$temp[$k] = explode(“,”,$v);
}
return $temp;
}
例1
代码示例
先来看array_multisort()函数
<?php
$ar = array(
array("10", 11, 100, 100, "a"),
array( 1, 2, "2", 3, 1)
);
array_multisort($ar[0], SORT_ASC, SORT_STRING,
$ar[1], SORT_NUMERIC, SORT_DESC);
var_dump($ar);
?>
mime_content_type返回指定文件的MIME类型,
用法:
先利用trim系列函数来删除左右空格
<?php
PHP中常用的关键字
final