php OOP類的用法_PHP教程

來源:互聯網
上載者:User
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("");}
$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

http://www.bkjia.com/PHPjc/631375.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/631375.htmlTechArticlephp類的用法 今天我們就php class用基本用法來講述一下,首先要你明白什麼是類:類的定義如下: 具有獨特性,具有靈活性,具有通用性,重要性,這...

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.