PHP便捷开发工具集合

php中文网
发布: 2016-06-23 13:35:22
原创
1527人浏览过

Belt 是 PHP 便捷开发工具。

Belt 主要特性:

Belt 包括:

  • boolean isDate(mixed $value)

  • boolean isNumber(mixed $value)

  • boolean isString(mixed $value)

  • boolean isFunction(mixed $value)

  • boolean isEmpty(mixed $value)

  • boolean isEqual(mixed $left, mixed $right)

  • boolean isBoolean(mixed $value)

  • boolean isObject(mixed $value)

  • boolean isArray(mixed $value)

  • boolean isTraversable(mixed $value)

  • boolean isNull(mixed $value)

  • boolean has(mixed $object, string $key)

  • array keys(mixed $object)

  • array values(mixed $object)

  • array methods(mixed $object)

  • mixed copy(mixed $value)

  • mixed extend(mixed $source, mixed $destination)

  • mixed apply(mixed $object, Closure $closure)

  • mixed defaults(mixed $object, array|mixed $defaults)

  • string escape(string $string)

  • string id(string $prefix = '')

  • mixed with(mixed $value)

  • void times(integer $number, Closure $closure)

  • mixed cache(Closure $closure)

  • mixed wrap(Closure $closure, Closure $wrapper)

  • mixed compose(array $closures, array $arguments = array())

  • void once(Closure $closure)

  • mixed after(integer $number, Closure $closure)

    LuckyCola工具库
    LuckyCola工具库

    LuckyCola工具库是您工作学习的智能助手,提供一系列AI驱动的工具,旨在为您的生活带来便利与高效。

    LuckyCola工具库 19
    查看详情 LuckyCola工具库
  • mixed|array first(array $elements, integer $amount = 1)

  • array initial(array $elements, integer $amount = 1)

  • array rest(array $elements, integer $index = 1)

  • mixed|array last(array $elements, integer $amount = 1)

  • array pack(array $elements)

  • array flatten(array $elements)

  • array range(integer $to, integer $from = 0, integer $step = 1)

  • array difference(array $one, array $another)

  • array unique(array $elements, Closure $iterator = null)

  • array without(array $elements, array $ignore)

  • array zip(array $one, array $another)

  • integer indexOf(array $elements, mixed $element)

  • array intersection(array $one, array $another)

  • array union(array $one, array $another)

  • void each(array $collection, Closure $iterator)

  • array map(array $collection, Closure $iterator)

  • array toArray(mixed $value)

  • integer|null size(array|Countable $value)

  • array shuffle(array $collection)

  • boolean any(array $collection, Closure $iterator)

  • boolean all(array $collection, Closure $iterator)

  • array reject(array $collection, Closure $iterator)

  • array pluck(array $collection, string $key)

  • boolean contains(array $collection, mixed $value)

  • array invoke(array $collection, string $function)

  • mixed reduce(array $collection, Closure $iterator, mixed $initial = 0)

  • array sortBy(array $collection, Closure $iterator)

  • array groupBy(array $collection, Closure $iterator)

  • mixed max(array $collection)

  • mixed min(array $collection)

简单示例:

use Belt\Belt;Belt::max([1, 2, 3]) // => 3Belt::flatten([1, [2, [3]]]) // => [1, 2, 3]Belt::last([1, 2, 3], 2) // => [2, 3]
登录后复制

项目主页:http://www.open-open.com/lib/view/home/1430832041179

PHP速学教程(入门到精通)
PHP速学教程(入门到精通)

PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!

下载
来源:php中文网
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
开源免费商场系统广告
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号