php 替换非法字符 保存到数据库
function _processBeforeDb($str)
{
$str = str_replace ( array ('<', '>' ), array ('<' , '>' ), $str );
if (!get_magic_quotes_runtime()){
return addslashes($str);
}
else
{
return $str;
}
}
相关文档:
1、到微软官方去下载新的驱动,下载地址如下:
http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=ccdf728b-1ea0-48a8-a84a-5052214caad9
官方文档有描述:
Refer to the documentation that is installed with the driver for a description of the new features in this ......
使用过SQL Server的人应该都清楚,SQL Server常用的有两种认证方式,一种是本地系统账户认证(Windows Authentication ),一种是使用用户名和密码(SQL Server Authentication ),第二种认证方式必须启用SQL Server的混合模式。
1.Windows Authentication连接部分代码段:
<?php
$serverName = "(local)";
$co ......
apache安装,mysql安装,php5直接解压,均放在D:\www下。
目录结构为:
D:\www\apache2
D:\www\mysql
D:\www\php5
将php5\php.ini-dist复制为php.ini,把需要用到的组件将前面的;去掉。
如
extension=php_mysql.dll
extension=php_gd2.dll
在apache2的conf/httpd.conf文件中加
LoadFile D:/www/php5/php5ts.dll
......
例:
要求匹配标题
<div class="detail-hd">
<h3>
五皇冠 2010春装新品时尚T恤 长袖 女装长款T恤 热卖韩版长T 特价
</h3>
$reg="|<div class=\"detail-hd\">[\n\r\t]*<h3>[\n\r\t]*(.*)[\n\r\t]*</h3>|";
pre ......