PHP Doku:: Convert attributes from object record to object array - function.hw-objrec2array.html

Verlauf / Chronik / History: (1) anzeigen

Sie sind hier:
Doku-StartseitePHP-HandbuchFunktionsreferenzSonstige DiensteHyperwaveHyperwave Funktionenhw_objrec2array

Ein Service von Reinhard Neidl - Webprogrammierung.

Hyperwave Funktionen

<<hw_New_Document

hw_Output_Document>>

hw_objrec2array

(PHP 4)

hw_objrec2arrayConvert attributes from object record to object array

Beschreibung

array hw_objrec2array ( string $object_record [, array $format ] )

Converts an object_record into an object array.

Parameter-Liste

object_record

The object record.

format

An associative array with the attribute name as its key and the value being one of HW_ATTR_LANG or HW_ATTR_NONE.

Rückgabewerte

Returns an array. The keys of the resulting array are the attributes names. Multi-value attributes like 'Title' in different languages form its own array. The keys of this array are the left part to the colon of the attribute value. This left part must be two characters long.

Other multi-value attributes without a prefix form an indexed array. If the optional parameter is missing the attributes 'Title', 'Description' and 'Keyword' are treated as language attributes and the attributes 'Group', 'Parent' and 'HtmlAttr' as non-prefixed multi-value attributes. By passing an array holding the type for each attribute you can alter this behaviour.

Siehe auch


Ein BenutzerBeitrag:
- Beiträge aktualisieren...
Anonymous
1.08.2010 6:22
You can also use:

<?php
//If your object is called $object:

$my_array = (array) $object;

//And to prove it worked:
print_r($my_array);
?>



PHP Powered Diese Seite bei php.net
The PHP manual text and comments are covered by the Creative Commons Attribution 3.0 License © the PHP Documentation Group - Impressum - mail("TO:Reinhard Neidl",...)