is_object

(PHP 4, PHP 5)

is_object — Finds whether a variable is an object

Описание

bool is_object ( mixed $var )

Finds whether the given variable is an object.

Список параметров

var

The variable being evaluated.

Возвращаемые значения

Returns TRUE if var is an object, FALSE otherwise.

Примечания

Замечание: This function will return FALSE if used on an unserialized object where the class definition is not present (even though gettype() returns object).

Смотрите также

Коментарии

Note: is_object(null) returns false

This should actually be part of the input/output specification at the top of this page.
2011-03-22 03:46:48
http://php5.kiev.ua/manual/ru/function.is-object.html
Unserializes data as returned by the standard PHP serialize() function. If the unserialized object is not an array, it will be converted to one, particularily useful if it returns a __PHP_Incomplete_Class.

<?php
/**
 * 
 * @param string $data Serialized data
 * 
 * @return array    Unserialized array
 */
function unserialize2array($data) {
   
$obj unserialize($data);
    if(
is_array($obj)) return $obj;
   
$arr = array();
    foreach(
$obj as $k=>$v) {
       
$arr[$k] = $v;
    }
    unset(
$arr['__PHP_Incomplete_Class_Name']);
    return 
$arr;
}
?>
2011-09-21 15:23:15
http://php5.kiev.ua/manual/ru/function.is-object.html

    Поддержать сайт на родительском проекте КГБ