PHP code example of sfneal / array-helpers
1. Go to this page and download the library: Download sfneal/array-helpers library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
sfneal / array-helpers example snippets
json
"autoload": {
"files": [
"vendor/sfneal/array-helpers/src/arrays.php"
]
},
php
$array = ['red' => 36, 'black' => 88, 'white' => 72];
// Remove a key from the array
use Sfneal\Helpers\Arrays\ArrayHelpers;
(new ArrayHelpers($array))->arrayRemoveKeys('red');
>>> ['black' => 88, 'white' => 72,];