Oihana PHP

ToAssociativeArray

Interface for objects that can be converted to associative arrays.

This interface defines a contract for objects that can provide an array representation of their data, useful for serialization, data export, or configuration management.

Tags
author

Marc Alcaraz (ekameleon)

since
1.0.8

Table of Contents

Methods

toArray()  : array<string|int, mixed>
Generates an associative array from the public properties of a given class or object.

Methods

toArray()

Generates an associative array from the public properties of a given class or object.

public toArray([array<string|int, mixed> $options = [] ]) : array<string|int, mixed>
Parameters
$options : array<string|int, mixed> = []
Return values
array<string|int, mixed>

The resulting associative array of properties.


        
On this page

Search results