易截截图软件、单文件、免安装、纯绿色、仅160KB

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

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 ......

PHP数组的使用和遍历

 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、遍历: ......

php引用文件方式

 引用文件的方法有2种:
1、require
require("conn.php"); 一般放在页面的第一行,做为该页执行的一部分,首先执行require内的conn.php 然后再执行下面的代码
2、include
include("header.php");当程序到达这里的时候才会执行include的 header.php ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号