search
Homephp教程PHP源码PHP中错误处理的一些方法

<script>ec(2);</script>

已经玩php一段时间了,基本是from0开始的,经常出现的问题也很多,慢慢的可以熟练的查询文档了,而且,经验也不是很多。

  先lookhere。:

error_reporting(1048);//1,2,4,7,...,1048
ob_start();
session_start();
date_default_timezone_set('Asia/Shanghai');

  php的递给调用会吃掉很多的内存。

  一般的,不要太多的使用define。

  在类的构造和属性器方面,5已经做了很多的工作,克服的bug就不说了,__系列的函数都有一些看点,也是支持static的。

  按照我现在的写过的程序,很少用到框架页面的,我感觉在php里面速度不在是一个问题。

  注意类的调用次序,特别是已经extends的,准确的释放掉内存。

  @mysql_fetch_array($result,MYSQL_ASSOC);

  这个注意使用乱用,MYSQL_ASSOC,MYSQL_NUM和MYSQL_BOTH是一个enum吧。默认的是MYSQL_BOTH.

  mysql的语句,如果执行in的话不再支持limit。so...很麻烦。

  支持distinct,group之,程序循环执行,md。 

if(get_magic_quotes_gpc()){
  $_GET=    stripslashes_gpc($_GET);
  $_POST=  stripslashes_gpc($_POST);
  $_COOKIE=  stripslashes_gpc($_COOKIE);
}
  set_magic_quotes_runtime(0);#magic_quotes_runtime
functionstripslashes_gpc($array){
  while(list($key,$value)=each($array)){
    if(is_string($value)){
      $array[$key]=addslashes(stripslashes($value));
    }elseif(is_array($value)) {
      $array[$key]=stripslashes_gpc($value);
    }
  }
  return$array;
}
/**
*处理程序中出现的错误
*@Date:2006-10-9-10:51
*@param  (类型)  (参数名)  (描述)
*/
functionError_Handler($errno,$errstr,$errorfile,$errline,$errtext){
 

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment