search
Homephp教程php手册php OOP类的用法

php OOP类的用法

Jun 13, 2016 am 10:03 AM
classoopphpone timeBasicususeusageofkind

php类的用法 今天我们就php class用基本用法来讲述一下,首先要你明白什么是类:类的定义如下:

具有独特性,具有灵活性,具有通用性,重要性,这是等的定义了,更详细的内容各位到www.111cn.cn查看就是了,好了为了让大家能更清楚的了解什么是OOP我们就来例子.

Class user{
  var $u_uid;  //username id english  
  var $u_mbname; // use temptlete
  var $u_css; //document  stylewww.111cn.cn
  var $u_documentbg; // full document background
  var $u_csstop; // doucument top background
  var $u_cssbottom; // bottom background
  var $u_realname; // username realname Chinse
  var $u_id; // tablename id replace tag;
  var $u_edu;
  var $u_work;
  var $u_head;www.111cn.cn
  var $u_sitename;
  var $u_visited;
  var $u_blog;  
  var $host;  

   function userinfo($id){
   $id =$this->safe_function($id);
   if(empty($id) || !is_numeric($id)){exit("<script>location='error.html';</script>");}   
   $sql  = "select * from uidname where u_id='$id'";
   $result  = mysql_query($sql) or die("Error system busy.....plase wait!");
   if(mysql_num_rows($result)){
    $rs  = mysql_fetch_object($result);
    $this->u_id   = $rs->id;www.111cn.cn
    $this->u_uid  = $rs->username;
    $this->u_realname = $rs->realname;
    $this->u_documentbg = $rs->documentbg;
    $this->u_csstop  = $rs->csstop;
    $this->u_cssbottom = $rs->cssbottom;
    $this->u_mbname  = $rs->mbname;
    $this->u_edu  = $rs->edu;
    $this->u_work  = $rs->works;
    $this->u_sitename = $rs->sitename;
    $this->u_visited = $rs->visited;
    $this->u_blog  = $rs->u_id;
   }else{
    header("location:blog/error.php");exit;
   }   
  }

}

注意:本站原创www.111cn.cn

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

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function