coderius/php-helpers
最新稳定版本:v0.0.2
Composer 安装命令:
composer require coderius/php-helpers
包简介
Provides php helpers.
README 文档
README
- ArrayHelper
ArrayHelper usage:
- ArrayHelper::toArray($object, $properties = [], $recursive = true)
- ArrayHelper::merge($ar, $ar2)
- ArrayHelper::getValue($array, $key, $default = null)
- ArrayHelper::setValue(&$array, $path, $value)
- ArrayHelper::remove(&$array, $key, $default = null)
- ArrayHelper::removeValue(&$array, $value)
- ArrayHelper::index($array, $key, $groups = [])
- ArrayHelper::getColumn($array, $name, $keepKeys = true)
- ArrayHelper::map($array, $from, $to, $group = null)
- ArrayHelper::keyExists($key, $array, $caseSensitive = true)
- ArrayHelper::multisort(&$array, $key, $direction = SORT_ASC, $sortFlag = SORT_REGULAR)
- ArrayHelper::htmlEncode($data, $valuesOnly = true, $charset = null)
- ArrayHelper::htmlDecode($data, $valuesOnly = true)
- ArrayHelper::isAssociative($array, $allStrings = true)
- ArrayHelper::isIndexed($array, $consecutive = false)
- ArrayHelper::isIn($needle, $haystack, $strict = false)
- ArrayHelper::isTraversable($var)
- ArrayHelper::isSubset($needles, $haystack, $strict = false)
- ArrayHelper::filter($array, $filters)
- ArrayHelper::recursiveSort(array &$array, $sorter = null)
Usage examples for ArrayHelper see in tests tests/Unit/ArrayHelperTest.php
Installation
The preferred way to install this extension is through composer.
Run the command in the terminal:
composer require "coderius/php-helpers"
Testing
- Go to root folder in terminal and run tests:
php ./vendor/bin/phpunit
统计信息
- 总下载量: 7
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-04-01