PHP: get_class - Manual in Deutsh
PHP: get_class - Manual in French
PHP: get_class - Manual in Polish

You Are At PHP: get_class - Manual Area


recent searches:
include functions , variable functions , post functions...




If you are new to PHP or just need to refresh your skills, this is the place to start. This series of tutorials will give you the basic knowledge you will need to create a simple PHP website.

PHP is a reflective programming language originally designed for producing dynamic web pages.[1] PHP is used mainly in server-side scripting, but can be used from a command line interface or in standalone graphical applications. Textual User Interfaces can also be created using ncurses.

PHP Manual
PrevNext

get_class

(PHP 4, PHP 5)

get_class -- Returns the name of the class of an object

Description

string get_class ( [object object] )

Gets the name of the class of the given object.

Parameters

object

The tested object

Return Values

Returns the name of the class of which object is an instance. Returns FALSE if object is not an object.

ChangeLog

VersionDescription
Since 5.0.0 The class name is returned in it's original notation.
Since 5.0.0 The object parameter is optional if called from the object's method.

Examples

Example 1. Using get_class()

<?php

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

    function
name()
    {
        echo
"My name is " , get_class($this) , "\n";
    }
}

// create an object
$bar = new foo();

// external call
echo "Its name is " , get_class($bar) , "\n";

// internal call
$bar->name();

?>

The above example will output:

Its name is foo
My name is foo

See Also

get_parent_class()
gettype()
is_subclass_of()

szkolenia zawodowe kursy zawodowe przygotowanie do zawodu
Crm dedykowany
najlepsza strona blogs o UKS profesjonalne wyniki
Skuteczne pozycjonowanie stron łódź i cała Polska.
przetargi Adamówka

Another Useful functions:


zend-api.zend-u-get-constant | zend-api.zend-hash-get-current-key | zend-api.zend-hash-get-current-key-type | zend-api.zend-hash-get-current-key-type-ex | zend-api.zend-hash-get-current-key-ex | zend-api.zend-hash-get-current-data | zend-api.zend-hash-get-current-data-ex | zend-api.zend-get-constant | zend-api.zend-get-configuration-directive | zend-api.zend-get-compiled-variable-value | zend-api.zend-get-compiled-variable-name | zend-api.zend-get-compiled-script-encoding | zend-api.zend-get-compiled-lineno | zend-api.zend-get-compiled-filename | zend-api.zend-get-class-entry | function.zlib-get-coding-type | function.xml-get-current-line-number | function.xml-get-current-column-number | function.xml-get-current-byte-index | function.tidy-get-config | function.stream-get-contents | function.session-get-cookie-params | function.ob-get-contents | function.ob-get-clean | function.newt-radio-get-current | function.newt-listbox-get-current | function.newt-form-get-current | function.newt-checkbox-tree-get-current | function.mysqli-get-client-version | function.mysqli-get-client-info | function.mysqli-get-charset | function.mysql-get-client-info | function.mcrypt-get-cipher-name | function.maxdb-get-client-version | function.maxdb-get-client-info | function.ifx-get-char | function.get-current-user | function.get-class | function.get-class-vars | function.get-class-methods | function.get-cfg-var | function.file-get-contents | function.domnode-get-content |


PHP is a widely-used general-purpose scripting language that is especially suited for Web development and can be embedded into HTML. If you are new to PHP and want to get some idea of how it works, try the introductory tutorial. After that, check out the online manual, and the example archive sites and some of the other resources available in the links section.