php实现替换UTF
批量去除BOM的程序
function
replace_utf8bom(
$str
)
{
$charset
[1] =
substr
(
$str
,0,1);
$charset
[2] =
substr
(
$str
,1,1);
$charset
[3] =
substr
(
$str
,2,1);
if
(ord(
$charset
[1]) == 239 && ord(
$charset
[2]) == 187 && ord(
$charset
[3]) == 191)
{
return
substr
(
$str
,3);
}
else
{
return
false;
}
}
很明显,这就是前面三个字符是固定的原因,当然可以这样判断了。。。说白了很简单,但如果不知道就真的很痛苦了。顺便说一下,它来自:http://www.phptext.net/technology.php?vid=53
相关文档:
PHP Security for Deployers
If you're a Developer
READ THIS and then work with your SysAdmins to step through any and all the layers of security designed to protect your apps.
Example:
Traffic must first pass through a SPI firewall (ensure that ONLY necessary ports/protocols are permitted; en ......
1、数组的申请和使用:
$array=array(array(2,324,34));
echo $array[0][1];
直接申请使用:
$student[0][0]="我";
$student[0][1]="是";
$student[1][0]="谁";
$student[1][1]="维";
echo $student[1][0];
2、遍历: ......
引用文件的方法有2种:
1、require
require("conn.php"); 一般放在页面的第一行,做为该页执行的一部分,首先执行require内的conn.php 然后再执行下面的代码
2、include
include("header.php");当程序到达这里的时候才会执行include的 header.php ......