{"id":22747154,"url":"https://github.com/cs-eliseev/helpers-arrays","last_synced_at":"2025-10-12T10:21:46.532Z","repository":{"id":56959770,"uuid":"174820558","full_name":"cs-eliseev/helpers-arrays","owner":"cs-eliseev","description":"Array helpers provides extra static methods allowing you to deal with arrays more efficiently.","archived":false,"fork":false,"pushed_at":"2019-05-06T05:06:14.000Z","size":111,"stargazers_count":5,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-07-21T22:46:16.439Z","etag":null,"topics":["array","arrays","collection","collections","cse","framework","helper","helpers","library","php","tool","tools","utilities","utility","utils"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cs-eliseev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-03-10T12:28:50.000Z","updated_at":"2025-05-26T02:12:49.000Z","dependencies_parsed_at":"2022-08-21T05:10:22.849Z","dependency_job_id":null,"html_url":"https://github.com/cs-eliseev/helpers-arrays","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/cs-eliseev/helpers-arrays","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cs-eliseev%2Fhelpers-arrays","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cs-eliseev%2Fhelpers-arrays/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cs-eliseev%2Fhelpers-arrays/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cs-eliseev%2Fhelpers-arrays/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cs-eliseev","download_url":"https://codeload.github.com/cs-eliseev/helpers-arrays/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cs-eliseev%2Fhelpers-arrays/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279011060,"owners_count":26084864,"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","status":"online","status_checked_at":"2025-10-12T02:00:06.719Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","arrays","collection","collections","cse","framework","helper","helpers","library","php","tool","tools","utilities","utility","utils"],"created_at":"2024-12-11T03:13:25.224Z","updated_at":"2025-10-12T10:21:46.483Z","avatar_url":"https://github.com/cs-eliseev.png","language":"PHP","funding_links":["https://www.paypal.me/cseliseev/10usd"],"categories":[],"sub_categories":[],"readme":"English | [Русский](https://github.com/cs-eliseev/helpers-arrays/blob/master/README.ru_RU.md)\n\nARRAYS CSE HELPERS\n=======\n\n[![Travis (.org)](https://img.shields.io/travis/cs-eliseev/helpers-arrays.svg?style=flat-square)](https://travis-ci.org/cs-eliseev/helpers-arrays)\n[![Codecov](https://img.shields.io/codecov/c/github/cs-eliseev/helpers-arrays.svg?style=flat-square)](https://codecov.io/gh/cs-eliseev/helpers-arrays)\n[![Scrutinizer code quality](https://img.shields.io/scrutinizer/g/cs-eliseev/helpers-arrays.svg?style=flat-square)](https://scrutinizer-ci.com/g/cs-eliseev/helpers-arrays/?branch=master)\n\n[![Packagist](https://img.shields.io/packagist/v/cse/helpers-arrays.svg?style=flat-square)](https://packagist.org/packages/cse/helpers-arrays)\n[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%207.1-8892BF.svg?style=flat-square)](https://packagist.org/packages/cse/helpers-arrays)\n[![Packagist](https://img.shields.io/packagist/l/cse/helpers-arrays.svg?style=flat-square)](https://github.com/cs-eliseev/helpers-arrays/blob/master/LICENSE.md)\n[![GitHub repo size](https://img.shields.io/github/repo-size/cs-eliseev/helpers-arrays.svg?style=flat-square)](https://github.com/cs-eliseev/helpers-arrays/archive/master.zip)\n\nArray helpers provides extra static methods allowing you to deal with arrays more efficiently.\n\nProject repository: https://github.com/cs-eliseev/helpers-arrays\n\n**DEMO**\n```php\n$array = [\n    0 =\u003e ' first 1 ',\n    'key1' =\u003e false,\n    1 =\u003e '',\n    2 =\u003e '0',\n    'key4' =\u003e null,\n    3 =\u003e [\n        0 =\u003e ' first 3',\n        1 =\u003e false,\n        'key2' =\u003e '',\n        2 =\u003e '0',\n        'key5' =\u003e null,\n        'key6' =\u003e 12,\n        3 =\u003e [],\n        4 =\u003e 'first 4 '\n    ],\n    4 =\u003e true,\n    5 =\u003e [],\n    'key8' =\u003e 'first 2 '\n];\n\n$array = Arrays::trim(Arrays::removeNull(Arrays::removeEmpty($array), true), true);\n/**\n * [\n *     0 =\u003e 'first 1',\n *     3 =\u003e [\n *         0 =\u003e 'first 3',\n *         1 =\u003e false,\n *         'key2' =\u003e '',\n *         2 =\u003e '0',\n *         'key6' =\u003e 12,\n *         3 =\u003e [],\n *         4 =\u003e 'first 4'\n *     ],\n *     4 =\u003e true,\n *     'key8' =\u003e 'first 2 '\n * ]\n */\n$array2 = Arrays::pullKey($array, 3);\n/**\n * $array = [\n *     0 =\u003e 'first 1',\n *     4 =\u003e true,\n *     'key8' =\u003e 'first 2 '\n * ]\n * $array2 = [\n *     0 =\u003e 'first 3',\n *     1 =\u003e false,\n *     'key2' =\u003e '',\n *     2 =\u003e '0',\n *     'key6' =\u003e 12,\n *     3 =\u003e [],\n *     4 =\u003e 'first 4'\n * ]\n */\n$array = Arrays::mergeNotEmptyData($array, $array2);\n/**\n * [\n *     0 =\u003e 'first 3',\n *     4 =\u003e 'first 4',\n *     'key8' =\u003e 'first 2',\n *     'key6' =\u003e 12\n * ]\n */\nArrays::get($array, 0);\n// 'first 3'\n```\n\n***\n\n\n## Introduction\n\n[CSE HELPERS](https://github.com/cs-eliseev/helpers/blob/master/README.md) is a collection of several libraries with simple functions written in PHP for people.\n\nDespite using PHP as the main programming language for the Internet, its functions are not enough. \nARRAY CSE HELPERS provides extra static methods allowing you to deal with arrays more efficiently.\n\n[CSE HELPERS](https://github.com/cs-eliseev/helpers/blob/master/README.md) was created for the rapid development of web applications.\n\n**CSE Helpers project:**\n* [Array CSE helpers](https://github.com/cs-eliseev/helpers-arrays)\n* [Cookie CSE helpers](https://github.com/cs-eliseev/helpers-cookie)\n* [Date CSE helpers](https://github.com/cs-eliseev/helpers-date)\n* [Email CSE helpers](https://github.com/cs-eliseev/helpers-email)\n* [IP CSE helpers](https://github.com/cs-eliseev/helpers-ip)\n* [Json CSE helpers](https://github.com/cs-eliseev/helpers-json)\n* [Math Converter CSE helpers](https://github.com/cs-eliseev/helpers-math-converter)\n* [Phone CSE helpers](https://github.com/cs-eliseev/helpers-phone)\n* [Request CSE helpers](https://github.com/cs-eliseev/helpers-request)\n* [Session CSE helpers](https://github.com/cs-eliseev/helpers-session)\n* [Word CSE helpers](https://github.com/cs-eliseev/helpers-word)\n\nBelow you will find some information on how to init library and perform common commands.\n\n\n## Install\n\nYou can find the most recent version of this project [here](https://github.com/cs-eliseev/helpers-arrays).\n\n### Composer\n\nExecute the following command to get the latest version of the package:\n```bash\ncomposer require cse/helpers-arrays\n```\n\nOr file composer.json should include the following contents:\n```json\n{\n    \"require\": {\n        \"cse/helpers-arrays\": \"*\"\n    }\n}\n```\n\n### Git\n\nClone this repository locally:\n```bash\ngit clone https://github.com/cs-eliseev/helpers-arrays.git\n```\n\n### Download\n\n[Download the latest release here](https://github.com/cs-eliseev/helpers-arrays/archive/master.zip).\n\n\n\n## Usage\n\nThe class consists of static methods that are conveniently used in any project. \nSee example [examples-arrays.php](https://github.com/cs-eliseev/helpers-arrays/blob/master/examples/examples-arrays.php).\n\n**GET array data by key**\n\nExample:\n```php\nArrays::get([\n    'key1' =\u003e 'value1',\n    'key2' =\u003e 'value2',\n    'key3' =\u003e 'value3'\n], 'key1');\n// value1\n```\n\nSet default value for not exist key:\n```php\nArrays::get([\n    'key1' =\u003e 'value1',\n    'key2' =\u003e 'value2',\n    'key3' =\u003e 'value3'\n], 'key4', 'default1');\n// default1\n```\n\n**Pull array key**\n\nExample:\n```php\nArrays::pullKey([\n    'key1' =\u003e 'value1',\n    'key2' =\u003e 'value2',\n    'key3' =\u003e 'value3'\n], 'key1');\n// value1\n/**\n* [\n*     'key2' =\u003e 'value2',\n*     'key3' =\u003e 'value3'\n* ]\n*/\n```\n\nSet default value for not exist key:\n```php\nArrays::pullKey([\n    'key1' =\u003e 'value1',\n    'key2' =\u003e 'value2',\n    'key3' =\u003e 'value3'\n], 'key4', 'default1');\n// default1\n```\n\n**Convert OBJECT TO ARRAY**\n\nExample:\n```php\n$object = new \\stdClass();\n$object-\u003ekey1 = 'value1';\n$object-\u003ekey2 = 'value2';\nArrays::objectToArray($object);\n/**\n* [\n*     'key1' =\u003e 'value1',\n*     'key2' =\u003e 'value2'\n* ]\n*/\n```\n\n**Convert array TO html TAG**\n\nExample:\n```php\nArrays::toTags([\n    'tag1' =\u003e [\n        1,\n        'attr1' =\u003e 1,\n        'attr2' =\u003e 2\n    ],\n    'tag2' =\u003e 2,\n    'tag3'\n]);\n// \u003ctag1 attr1=\"1\" attr2=\"2\"\u003e1\u003c/tag1\u003e\u003ctag2\u003e2\u003c/tag2\u003e\u003ctag3 /\u003e\n```\n\n**Convert array to MAP**\n\nData:\n```php\n$array = [\n    [\n        'keyGroup1' =\u003e 'value1',\n        'keyGroup2' =\u003e 'value2',\n        'keyGroup3' =\u003e 'value3'\n    ], [\n        'keyGroup2' =\u003e 'value2',\n        'keyGroup3' =\u003e 'value3'\n    ], [\n        'keyGroup1' =\u003e 'value1',\n        'keyGroup3' =\u003e 'value2'\n    ]\n];\n```\n\nExample:\n```php\nArrays::map($array, 'keyGroup1');\n/**\n* [\n*     'value1' =\u003e [\n*           'keyGroup1' =\u003e 'value1',\n*           'keyGroup3' =\u003e 'value2'\n*     ]\n* ]\n*/\n```\n\nChange key group:\n```php\nArrays::map($array, 'keyGroup2');\n/**\n* [\n*     'value2' =\u003e [\n*           'keyGroup2' =\u003e 'value2',\n*           'keyGroup3' =\u003e 'value3'\n*     ]\n* ]\n*/\n```\n\nSet key value:\n```php\nArrays::map($array, 'keyGroup3', 'keyGroup1');\n/**\n* [\n*     'value3' =\u003e null,\n*     'value2' =\u003e 'value1'\n* ]\n*/\n```\n\n**Array GROUP**\n\nData:\n```php\n$array = [\n    [\n        'keyGroup1' =\u003e 'value1',\n        'keyGroup2' =\u003e 'value2',\n        'keyGroup3' =\u003e 'value3'\n    ], [\n        'keyGroup2' =\u003e 'value2',\n        'keyGroup3' =\u003e 'value3'\n    ], [\n        'keyGroup1' =\u003e 'value1',\n        'keyGroup3' =\u003e 'value2'\n    ]\n];\n```\n\nExample:\n```php\nArrays::group($array, 'keyGroup1');\n/**\n* [\n*     'value1' =\u003e [\n*         [\n*             'keyGroup1' =\u003e 'value1',\n*             'keyGroup2' =\u003e 'value2',\n*             'keyGroup3' =\u003e 'value3'\n*         ], [\n*             'keyGroup1' =\u003e 'value1',\n*             'keyGroup3' =\u003e 'value2'\n*         ]\n*     ]\n* ]\n*/\n```\n\nChange key group:\n```php\nArrays::group($array, 'keyGroup2');\n/**\n* [\n*     'value1' =\u003e [\n*         [\n*             'keyGroup1' =\u003e 'value1',\n*             'keyGroup2' =\u003e 'value2',\n*             'keyGroup3' =\u003e 'value3'\n*         ], [\n*             'keyGroup2' =\u003e 'value2',\n*             'keyGroup3' =\u003e 'value3'\n*         ]\n*     ]\n* ]\n*/\n```\n\nSet key value:\n```php\nArrays::group($array, 'keyGroup3', 'keyGroup1');\n/**\n* [\n*     'value3' =\u003e [\n*         [\n*             'value1',\n*             null\n*         ]\n*     ],\n*     'value2' =\u003e [\n*         [\n*             'value1'\n*         ]\n*     ],\n* ]\n*/\n```\n\n**Array INDEX**\n\nData:\n```php\n$array = [\n    [\n        'keyGroup1' =\u003e 'value1',\n        'keyGroup2' =\u003e 'value2',\n        'keyGroup3' =\u003e 'value3'\n    ], [\n        'keyGroup2' =\u003e 'value2',\n        'keyGroup3' =\u003e 'value3'\n    ], [\n        'keyGroup1' =\u003e 'value1',\n        'keyGroup3' =\u003e 'value2'\n    ]\n];\n```\n\nExample:\n```php\nArrays::index($array, 'keyGroup1');\n/**\n* [\n*     'value1' =\u003e [\n*         [\n*             'keyGroup1' =\u003e 'value1',\n*             'keyGroup2' =\u003e 'value2',\n*             'keyGroup3' =\u003e 'value3'\n*         ], [\n*             'keyGroup1' =\u003e 'value1',\n*             'keyGroup3' =\u003e 'value2'\n*         ]\n*     ]\n* ]\n*/\n```\n\nChange key group:\n```php\nArrays::index($array, 'keyGroup2');\n/**\n* [\n*     'value1' =\u003e [\n*         [\n*             'keyGroup1' =\u003e 'value1',\n*             'keyGroup2' =\u003e 'value2',\n*             'keyGroup3' =\u003e 'value3'\n*         ], [\n*             'keyGroup2' =\u003e 'value2',\n*             'keyGroup3' =\u003e 'value3'\n*         ]\n*     ]\n* ]\n*/\n```\n\nSet key value:\n```php\nArrays::index($array, 'keyGroup3', 'keyGroup1');\n/**\n* [\n*     'value3' =\u003e [\n*         [\n*             'value1',\n*             null\n*         ]\n*     ],\n*     'value2' =\u003e [\n*         [\n*             'value1'\n*         ]\n*     ],\n* ]\n*/\n```\n\n**APPEND NOT EMPTY DATA**\n\nExample:\n```php\nArrays::appendNotEmptyData([\n1 =\u003e 'first1',\n    2 =\u003e '',\n    3 =\u003e '0',\n    4 =\u003e null,\n    5 =\u003e 'first5',\n    6 =\u003e 'first6',\n    7 =\u003e 'first7',\n    8 =\u003e [],\n    9 =\u003e 'first9',\n    11 =\u003e 'first11'\n], [\n    1 =\u003e 'second1',\n    2 =\u003e 'second2',\n    3 =\u003e 'second3',\n    4 =\u003e 'second4',\n    5 =\u003e '',\n    6 =\u003e '0',\n    7 =\u003e null,\n    8 =\u003e 'second8',\n    9 =\u003e [],\n    10 =\u003e 'second10'\n    12 =\u003e 0\n]);\n/**\n* [\n*     1 =\u003e 'first1',\n*     2 =\u003e '',\n*     3 =\u003e '0',\n*     4 =\u003e null,\n*     5 =\u003e 'first5',\n*     6 =\u003e 'first6',\n*     7 =\u003e 'first7',\n*     8 =\u003e [],\n*     9 =\u003e 'first9',\n*     11 =\u003e 'first11',\n*     10 =\u003e 'second10'\n* ]\n*/\n```\n\n**REPLACE EMPTY NOT EMPTY DATA**\n\nExample:\n```php\nArrays::replaceEmptyNotEmptyData([\n1 =\u003e 'first1',\n    2 =\u003e '',\n    3 =\u003e '0',\n    4 =\u003e null,\n    5 =\u003e 'first5',\n    6 =\u003e 'first6',\n    7 =\u003e 'first7',\n    8 =\u003e [],\n    9 =\u003e 'first9',\n    11 =\u003e 'first11'\n], [\n    1 =\u003e 'second1',\n    2 =\u003e 'second2',\n    3 =\u003e 'second3',\n    4 =\u003e 'second4',\n    5 =\u003e '',\n    6 =\u003e '0',\n    7 =\u003e null,\n    8 =\u003e 'second8',\n    9 =\u003e [],\n    10 =\u003e 'second10'\n    12 =\u003e 0\n]);\n/**\n* [\n*     1 =\u003e 'first1',\n*     2 =\u003e 'second2',\n*     3 =\u003e 'second3',\n*     4 =\u003e 'second4',\n*     5 =\u003e 'first5',\n*     6 =\u003e 'first6',\n*     7 =\u003e 'first7',\n*     8 =\u003e 'second8',\n*     9 =\u003e 'first9',\n*     11 =\u003e 'first11'\n* ]\n*/\n```\n\n**REPLACE NOT EMPTY DATA**\n\nExample:\n```php\nArrays::replaceNotEmptyData([\n1 =\u003e 'first1',\n    2 =\u003e '',\n    3 =\u003e '0',\n    4 =\u003e null,\n    5 =\u003e 'first5',\n    6 =\u003e 'first6',\n    7 =\u003e 'first7',\n    8 =\u003e [],\n    9 =\u003e 'first9',\n    11 =\u003e 'first11'\n], [\n    1 =\u003e 'second1',\n    2 =\u003e 'second2',\n    3 =\u003e 'second3',\n    4 =\u003e 'second4',\n    5 =\u003e '',\n    6 =\u003e '0',\n    7 =\u003e null,\n    8 =\u003e 'second8',\n    9 =\u003e [],\n    10 =\u003e 'second10'\n    12 =\u003e 0\n]);\n/**\n* [\n*     1 =\u003e 'second1',\n*     2 =\u003e 'second2',\n*     3 =\u003e 'second3',\n*     4 =\u003e 'second4',\n*     5 =\u003e 'first5',\n*     6 =\u003e 'first6',\n*     7 =\u003e 'first7',\n*     8 =\u003e 'second8',\n*     9 =\u003e 'first9',\n*     11 =\u003e 'first11'\n* ]\n*/\n```\n\n**MERGE NOT EMPTY DATA**\n\nExample:\n```php\nArrays::mergeNotEmptyData([\n1 =\u003e 'first1',\n    2 =\u003e '',\n    3 =\u003e '0',\n    4 =\u003e null,\n    5 =\u003e 'first5',\n    6 =\u003e 'first6',\n    7 =\u003e 'first7',\n    8 =\u003e [],\n    9 =\u003e 'first9',\n    11 =\u003e 'first11'\n], [\n    1 =\u003e 'second1',\n    2 =\u003e 'second2',\n    3 =\u003e 'second3',\n    4 =\u003e 'second4',\n    5 =\u003e '',\n    6 =\u003e '0',\n    7 =\u003e null,\n    8 =\u003e 'second8',\n    9 =\u003e [],\n    10 =\u003e 'second10'\n    12 =\u003e 0\n]);\n/**\n* [\n*     1 =\u003e 'second1',\n*     2 =\u003e 'second2',\n*     3 =\u003e 'second3',\n*     4 =\u003e 'second4',\n*     5 =\u003e 'first5',\n*     6 =\u003e 'first6',\n*     7 =\u003e 'first7',\n*     8 =\u003e 'second8',\n*     9 =\u003e 'first9',\n*     11 =\u003e 'first11',\n*     10 =\u003e 'second10'\n* ]\n*/\n```\n\n**Replace EMPTY array data TO NULL**\n\nData:\n```php\n$array = [\n    0 =\u003e ' first 1 ', \n    'key1' =\u003e false, \n    1 =\u003e '', \n    2 =\u003e '0', \n    'key4' =\u003e null, \n    3 =\u003e [\n        0 =\u003e ' first 3', \n        1 =\u003e false, \n        'key2' =\u003e '', \n        2 =\u003e '0', \n        'key5' =\u003e null, \n        'key6' =\u003e 12, \n        3 =\u003e [], \n        4 =\u003e 'first 4 '\n    ], \n    4 =\u003e true, \n    5 =\u003e [], \n    'key8' =\u003e 'first 2 '\n];\n```\n\nExample:\n```php\nArrays::emptyToNull($array);\n/**\n* [\n*     0 =\u003e ' first 1 ', \n*     'key1' =\u003e null, \n*     1 =\u003e null, \n*     2 =\u003e null, \n*     'key4' =\u003e null, \n*     3 =\u003e [\n*         0 =\u003e ' first 3', \n*         1 =\u003e false, \n*         'key2' =\u003e '', \n*         2 =\u003e '0', \n*         'key5' =\u003e null, \n*         'key6' =\u003e 12, \n*         3 =\u003e [], \n*         4 =\u003e 'first 4 '\n*     ], \n*     4 =\u003e true, \n*     5 =\u003e null, \n*     'key8' =\u003e 'first 2 '\n* ]\n*/\n```\n\nRecursive:\n```php\nArrays::emptyToNull($array, true);\n/**\n* [\n*     0 =\u003e ' first 1 ', \n*     'key1' =\u003e null, \n*     1 =\u003e null, \n*     2 =\u003e null, \n*     'key4' =\u003e null, \n*     3 =\u003e [\n*         0 =\u003e ' first 3', \n*         1 =\u003e null, \n*         'key2' =\u003e null, \n*         2 =\u003e null, \n*         'key5' =\u003e null, \n*         'key6' =\u003e 12, \n*         3 =\u003e null, \n*         4 =\u003e 'first 4 '\n*     ], \n*     4 =\u003e true, \n*     5 =\u003e null, \n*     'key8' =\u003e 'first 2 '\n* ]\n*/\n```\n\n**REMOVE EMPTY data to array**\n\nData:\n```php\n$array = [\n    0 =\u003e ' first 1 ', \n    'key1' =\u003e false, \n    1 =\u003e '', \n    2 =\u003e '0', \n    'key4' =\u003e null, \n    3 =\u003e [\n        0 =\u003e ' first 3', \n        1 =\u003e false, \n        'key2' =\u003e '', \n        2 =\u003e '0', \n        'key5' =\u003e null, \n        'key6' =\u003e 12, \n        3 =\u003e [], \n        4 =\u003e 'first 4 '\n    ], \n    4 =\u003e true, \n    5 =\u003e [], \n    'key8' =\u003e 'first 2 '\n];\n```\n\nExample:\n```php\nArrays::removeEmpty($array);\n/**\n* [\n*     0 =\u003e ' first 1 ', \n*     3 =\u003e [\n*         0 =\u003e ' first 3', \n*         1 =\u003e false, \n*         'key2' =\u003e '', \n*         2 =\u003e '0', \n*         'key5' =\u003e null, \n*         'key6' =\u003e 12, \n*         3 =\u003e [], \n*         4 =\u003e 'first 4 '\n*     ], \n*     4 =\u003e true, \n*     'key8' =\u003e 'first 2 '\n* ]\n*/\n```\n\nRecursive:\n```php\nArrays::removeEmpty($array, true);\n/**\n* [\n*     0 =\u003e ' first 1 ', \n*     3 =\u003e [\n*         0 =\u003e ' first 3', \n*         'key6' =\u003e 12, \n*         4 =\u003e 'first 4 '\n*     ], \n*     4 =\u003e true, \n*     'key8' =\u003e 'first 2 '\n* ]\n*/\n```\n\n**REMOVE NULL data to array**\n\nData:\n```php\n$array = [\n    0 =\u003e ' first 1 ', \n    'key1' =\u003e false, \n    1 =\u003e '', \n    2 =\u003e '0', \n    'key4' =\u003e null, \n    3 =\u003e [\n        0 =\u003e ' first 3', \n        1 =\u003e false, \n        'key2' =\u003e '', \n        2 =\u003e '0', \n        'key5' =\u003e null, \n        'key6' =\u003e 12, \n        3 =\u003e [], \n        4 =\u003e 'first 4 '\n    ], \n    4 =\u003e true, \n    5 =\u003e [], \n    'key8' =\u003e 'first 2 '\n];\n```\n\nExample:\n```php\nArrays::removeNull($array);\n/**\n* [\n*     0 =\u003e ' first 1 ', \n*     'key1' =\u003e false, \n*     1 =\u003e '', \n*     2 =\u003e '0', \n*     3 =\u003e [\n*         0 =\u003e ' first 3', \n*         1 =\u003e false, \n*         'key2' =\u003e '', \n*         2 =\u003e '0', \n*         'key5' =\u003e null, \n*         'key6' =\u003e 12, \n*         3 =\u003e [], \n*         4 =\u003e 'first 4 '\n*     ], \n*     4 =\u003e true, \n*     5 =\u003e [], \n*     'key8' =\u003e 'first 2 '\n* ]\n*/\n```\n\nRecursive:\n```php\nArrays::removeNull($array, true);\n/**\n* [\n*     0 =\u003e ' first 1 ', \n*     'key1' =\u003e false, \n*     1 =\u003e '', \n*     2 =\u003e '0', \n*     3 =\u003e [\n*         0 =\u003e ' first 3', \n*         1 =\u003e false, \n*         'key2' =\u003e '', \n*         2 =\u003e '0', \n*         'key6' =\u003e 12, \n*         3 =\u003e [], \n*         4 =\u003e 'first 4 '\n*     ], \n*     4 =\u003e true, \n*     5 =\u003e [], \n*     'key8' =\u003e 'first 2 '\n* ]\n*/\n```\n\n**TRIM array data**\n\nData:\n```php\n$array = [\n    0 =\u003e ' first 1 ', \n    'key1' =\u003e false, \n    1 =\u003e '', \n    2 =\u003e '0', \n    'key4' =\u003e null, \n    3 =\u003e [\n        0 =\u003e ' first 3', \n        1 =\u003e false, \n        'key2' =\u003e '', \n        2 =\u003e '0', \n        'key5' =\u003e null, \n        'key6' =\u003e 12, \n        3 =\u003e [], \n        4 =\u003e 'first 4 '\n    ], \n    4 =\u003e true, \n    5 =\u003e [], \n    'key8' =\u003e 'first 2 '\n];\n```\n\nExample:\n```php\nArrays::trim($array);\n/**\n* [\n*     0 =\u003e 'first 1', \n*     'key1' =\u003e false, \n*     1 =\u003e '', \n*     2 =\u003e '0', \n*     'key4' =\u003e null,\n*     3 =\u003e [\n*         0 =\u003e ' first 3', \n*         1 =\u003e false, \n*         'key2' =\u003e '', \n*         2 =\u003e '0', \n*         'key5' =\u003e null, \n*         'key6' =\u003e 12, \n*         3 =\u003e [], \n*         4 =\u003e 'first 4 '\n*     ], \n*     4 =\u003e true, \n*     5 =\u003e [], \n*     'key8' =\u003e 'first 2'\n* ]\n*/\n```\n\nRecursive:\n```php\nArrays::trim($array, true);\n/**\n* [\n*     0 =\u003e 'first 1', \n*     'key1' =\u003e false, \n*     1 =\u003e '', \n*     2 =\u003e '0', \n*     'key4' =\u003e null,\n*     3 =\u003e [\n*         0 =\u003e 'first 3', \n*         1 =\u003e false, \n*         'key2' =\u003e '', \n*         2 =\u003e '0', \n*         'key5' =\u003e null, \n*         'key6' =\u003e 12, \n*         3 =\u003e [], \n*         4 =\u003e 'first 4'\n*     ], \n*     4 =\u003e true, \n*     5 =\u003e [], \n*     'key8' =\u003e 'first 2'\n* ]\n*/\n```\n\n**Array TO STRING**\n\nExample:\n```php\nArrays::toString([\n    'option1' =\u003e 'value1',\n    'option2' =\u003e 'value2',\n]);\n// option1:value1;option2:value2;\n```\n\nChange delimiter:\n```php\nArrays::toString([\n    'option1' =\u003e 'value1',\n    'option2' =\u003e 'key1:value1;key1:value2;',\n], '=\"', '\" ');\n// option1=\"value1\" option2=\"key1:value1;key1:value2;\" \n```\n\n## Testing \u0026 Code Coverage\n\nPHPUnit is used for unit testing. Unit tests ensure that class and methods does exactly what it is meant to do.\n\nGeneral PHPUnit documentation can be found at https://phpunit.de/documentation.html.\n\nTo run the PHPUnit unit tests, execute:\n```bash\nphpunit PATH/TO/PROJECT/tests/\n```\n\nIf you want code coverage reports, use the following:\n```bash\nphpunit --coverage-html ./report PATH/TO/PROJECT/tests/\n```\n\nUsed PHPUnit default config:\n```bash\nphpunit --configuration PATH/TO/PROJECT/phpunit.xml\n```\n\n\n## Donating\n\nYou can support this project [here](https://www.paypal.me/cseliseev/10usd). \nYou can also help out by contributing to the project, or reporting bugs. \nEven voicing your suggestions for features is great. Anything to help is much appreciated.\n\n\n## License\n\nThe ARRAYS CSE HELPERS is open-source PHP library licensed under the MIT license. Please see [License File](https://github.com/cs-eliseev/helpers-arrays/blob/master/LICENSE.md) for more information.\n\n***\n\n\u003e GitHub [@cs-eliseev](https://github.com/cs-eliseev)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcs-eliseev%2Fhelpers-arrays","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcs-eliseev%2Fhelpers-arrays","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcs-eliseev%2Fhelpers-arrays/lists"}