{"id":15984951,"url":"https://github.com/divineomega/object_to_array","last_synced_at":"2025-03-18T01:30:27.179Z","repository":{"id":56969657,"uuid":"121260505","full_name":"DivineOmega/object_to_array","owner":"DivineOmega","description":"This PHP package provides an `object_to_array` helper function. You can use this function to convert an object to an array.","archived":false,"fork":false,"pushed_at":"2020-03-23T23:43:30.000Z","size":9,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-28T06:04:39.512Z","etag":null,"topics":["array","helper-functions","object","php","php-library"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DivineOmega.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-12T15:01:17.000Z","updated_at":"2020-03-23T23:43:33.000Z","dependencies_parsed_at":"2022-08-21T10:50:50.033Z","dependency_job_id":null,"html_url":"https://github.com/DivineOmega/object_to_array","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DivineOmega%2Fobject_to_array","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DivineOmega%2Fobject_to_array/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DivineOmega%2Fobject_to_array/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DivineOmega%2Fobject_to_array/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DivineOmega","download_url":"https://codeload.github.com/DivineOmega/object_to_array/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243893857,"owners_count":20364918,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["array","helper-functions","object","php","php-library"],"created_at":"2024-10-08T02:11:36.678Z","updated_at":"2025-03-18T01:30:26.869Z","avatar_url":"https://github.com/DivineOmega.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# `object_to_array` helper function\n\n[![Build Status](https://travis-ci.org/DivineOmega/object_to_array.svg?branch=master)](https://travis-ci.org/DivineOmega/object_to_array)\n[![Coverage Status](https://coveralls.io/repos/github/DivineOmega/object_to_array/badge.svg?branch=master)](https://coveralls.io/github/DivineOmega/object_to_array?branch=master)\n[![StyleCI](https://styleci.io/repos/121260505/shield?branch=master)](https://styleci.io/repos/121260505)\n\nThis PHP package provides an `object_to_array` helper function. You can use this function to convert an object to an array.\n\n## Installation\n\nThe `object_to_array` package can be easily installed using Composer. Just run the following command from the root of your project.\n\n```\ncomposer require \"divineomega/object_to_array\"\n```\n\nIf you have never used the Composer dependency manager before, head to the [Composer website](https://getcomposer.org/) for more information on how to get started.\n\n## Usage\n\nHere are a few examples of how to use the `object_to_array` helper function.\n\n```php\n// Basic object\n\n$object = new stdClass;\n$object-\u003ename = 'John';\n$object-\u003eage = 32;\n\n$array = object_to_array($object)\n\n/*\n$array = [\n    'name' =\u003e 'John',\n    'age' =\u003e 32\n];\n*/\n```\n\n```php\n// Object with nested object\n\n$object = new stdClass;\n$object-\u003ename = 'John';\n$object-\u003eage = 32;\n$object-\u003epet = new stdClass;\n$object-\u003epet-\u003etype = 'cat';\n$object-\u003epet-\u003ename = 'Mr Fluffkins The Third';\n\n$array = object_to_array($object)\n\n/*\n$array = [\n    'name' =\u003e 'John',\n    'age' =\u003e 32,\n    'pet' =\u003e [\n        'name' =\u003e 'Mr Fluffkins The Third',\n        'type' =\u003e 'cat'\n    ]\n];\n*/\n```\n\n```php\n// Object with nested array\n\n$object = new stdClass;\n$object-\u003ename = 'John';\n$object-\u003eage = 32;\n$object-\u003efavouriteFoods = [\n    'pizza',\n    'cake'\n];\n\n$array = object_to_array($object)\n\n/*\n$array = [\n    'name' =\u003e 'John',\n    'age' =\u003e 32,\n    'favouriteFoods' =\u003e [\n        'pizza',\n        'cake'\n    ]\n];\n*/\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdivineomega%2Fobject_to_array","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdivineomega%2Fobject_to_array","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdivineomega%2Fobject_to_array/lists"}