易截截图软件、单文件、免安装、纯绿色、仅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中mysql_fetch_array()和mysql_fetch_row()的区别

 最近在做PHP与数据库交互的project,急于求成,模仿了下例子就开始动手,结果误把mysql_fetch_array写成了mysql_fetch_row,囧事来了,发现返回的数组居然是index=>value的形式,而明明记得是field name=>value的哈,查手册才明白。
1. mysql_fetch_array的函数原型是
array mysql_fetch_array ( resour ......

apache中php连接远程数据库服务器的问题

问题描述:一个连接远程数据库的PHP脚本testdb.php,在浏览器中运行:http://localhost/testdb.php,出现错误:Can't connect to MySQL server on '10.60.56.220' (13),但是在本地用php命令行运行:php testdb.php,却正常地连上了数据库并读出了其中的数据。
应用程序环境:本地IP:10.60.56.90,本地电脑上安装Apache 2 ......

在Windows XP下配置PHP和Apache环境

    在windows操作系统配置PHP环境,可以用IIS做应用服务器,也可以使用Apache做应用服务器。本文介绍在Windows XP操作系统下配置PHP和Apache环境。
    准备工作:
    1、在http://windows.php.net/download/下载PHP程序包,因为用Apache做应用服务器,选择用VC6编译的 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号