Register Register Member Login Member Login Member Login Forgot Password ??
PHP , ASP , ASP.NET, VB.NET, C#, Java , jQuery , Android , iOS , Windows Phone
 

Registered : 109,027

HOME > PHP Manual > get_parent_class - Retrieves the parent class name for object or class





ลองใช้ค้นหาข้อมูล


   
Bookmark.

get_parent_class

(PHP 4, PHP 5)

get_parent_classRetrieves the parent class name for object or class

Description

string get_parent_class ([ mixed $object ] )

Retrieves the parent class name for object or class.

Parameters

object

The tested object or class name

Return Values

Returns the name of the parent class of the class of which object is an instance or the name.

Note: If the object does not have a parent FALSE will be returned.

If called without parameter outside object, this function returns FALSE.

ChangeLog

Version Description
Before 5.1.0 If called without parameter outside object, this function would have returned NULL with a warning.
Since 5.0.0 The object parameter is optional if called from the object's method.
Since 4.0.5 If object is a string, returns the name of the parent class of the class with that name.

Examples

Example #1 Using get_parent_class()

<?php

class dad {
    function 
dad()
    {
    
// implements some logic
    
}
}

class 
child extends dad {
    function 
child()
    {
        echo 
"I'm " get_parent_class($this) , "'s son\n";
    }
}

class 
child2 extends dad {
    function 
child2()
    {
        echo 
"I'm " get_parent_class('child2') , "'s son too\n";
    }
}

$foo = new child();
$bar = new child2();

?>

The above example will output:

I'm dad's son
I'm dad's son too



ThaiCreate.Com Forum


Comunity Forum Free Web Script
Jobs Freelance Free Uploads
Free Web Hosting Free Tools

สอน PHP ผ่าน Youtube ฟรี
สอน Android การเขียนโปรแกรม Android
สอน Windows Phone การเขียนโปรแกรม Windows Phone 7 และ 8
สอน iOS การเขียนโปรแกรม iPhone, iPad
สอน Java การเขียนโปรแกรม ภาษา Java
สอน Java GUI การเขียนโปรแกรม ภาษา Java GUI
สอน JSP การเขียนโปรแกรม ภาษา Java
สอน jQuery การเขียนโปรแกรม ภาษา jQuery
สอน .Net การเขียนโปรแกรม ภาษา .Net
Free Tutorial
สอน Google Maps Api
สอน Windows Service
สอน Entity Framework
สอน Android
สอน Java เขียน Java
Java GUI Swing
สอน JSP (Web App)
iOS (iPhone,iPad)
Windows Phone
Windows Azure
Windows Store
Laravel Framework
Yii PHP Framework
สอน jQuery
สอน jQuery กับ Ajax
สอน PHP OOP (Vdo)
Ajax Tutorials
SQL Tutorials
สอน SQL (Part 2)
JavaScript Tutorial
Javascript Tips
VBScript Tutorial
VBScript Validation
Microsoft Access
MySQL Tutorials
-- Stored Procedure
MariaDB Database
SQL Server Tutorial
SQL Server 2005
SQL Server 2008
SQL Server 2012
-- Stored Procedure
Oracle Database
-- Stored Procedure
SVN (Subversion)
แนวทางการทำ SEO
ปรับแต่งเว็บให้โหลดเร็ว


Hit Link
   







Load balance : Server 04
ThaiCreate.Com Logo
© www.ThaiCreate.Com. 2003-2024 All Rights Reserved.
ไทยครีเอทบริการ จัดทำดูแลแก้ไข Web Application ทุกรูปแบบ (PHP, .Net Application, VB.Net, C#)
[Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่