php 替换非法字符 保存到数据库
function _processBeforeDb($str)
{
$str = str_replace ( array ('<', '>' ), array ('<' , '>' ), $str );
if (!get_magic_quotes_runtime()){
return addslashes($str);
}
else
{
return $str;
}
}
相关文档:
<?php
//声明全局变量
$num = "张三";
//定义一个自定义方法
function my_fun($temp1,$temp2 = "people"){
//要数用方法外部声明的全局变量,必须使用关键字global先在
//自定义方法中获得到方法外部声明的全局变量的值,才能在方
......
PHP在页面上显示出错消息并让用户看见是开发人员怎么样也不愿意面对的,但是谁都不想在一台没有配置成显示出错消息的服务器上用PHP开发代码。开发时显示PHP的错误消息对开发人员来说是个明智的选择,所谓工具是使人方便的,就是如此。
下面来说说显示PHP错误提示消息的三个方法。
一:php.ini配置
php.ini配 ......
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 ......
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
......
/*************十进制大整数相乘****************/
/*********
* $A,$B均为字符串
*/
function multipication ($A,$B){
$sResult = "";
  ......