Marray
PHP Array toolkit extension.
Install / Use
/learn @gajus/MarrayREADME
Marray
Extension to the already vast PHP array toolkit.
/**
* Strip-down $input to values where $input key is found among $template values.
*
* @throws Gajus\Marray\Exception\InvalidArgumentException If input is not an associative array.
* @throws Gajus\Marray\Exception\InvalidArgumentException If template is not a list.
* @throws Gajus\Marray\Exception\InvalidArgumentException If $input does not have all the keys defined in $template.
* @param array $input
* @param array $template
* @return array
*/
array \Gajus\Marray\template ( array $input, array $template )
/**
* http://php.net/array_intersect recursive implementation.
*
* @param array $arr1 The array with master values to check.
* @param array $arr2 An array to compare values against.
* @param array ... A variable list of arrays to compare.
* @return array
*/
array \Gajus\Marray\intersect_recursive ( array $arr1 , array $arr2 [, array $... ] )
/**
* http://php.net/array_diff_key recursive implementation.
*
* @todo Support variadic input.
* @param array $arr1 The array with master keys to check.
* @param array $arr2 An array to compare keys against.
* @return array
*/
array \Gajus\Marray\diff_key_recursive ( array $arr1 , array $arr )
/**
* http://php.net/array_unique implementation with user callback.
*
* @param array The input array.
* @param callable $value_func Function must return the value used for comparison.
* @param int $sort_flags
*/
array \Gajus\Marray\uunique ($array, callable $value_func, $sort_flags = \SORT_STRING)
/**
* http://uk1.php.net/array_walk_recursive implementation that is used to remove nodes from the array.
*
* @param array The input array.
* @param callable $callback Function must return boolean value indicating whether to remove the node.
* @return array
*/
function walk_recursive_remove (array $array, callable $callback)
Related Skills
node-connect
343.3kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
92.1kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
343.3kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
343.3kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。


