PHP convenient development tool set

Source: Internet
Author: User
The PHP convenient development tool set Belt is a convenient PHP development tool.

Belt features:

  • 60 +Useful functions

  • Complete tests

  • Clear code and complete documentation

Belt includes:

  • 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)

  • 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)

Simple example:

use Belt\Belt;Belt::max([1, 2, 3]) // => 3Belt::flatten([1, [2, [3]]]) // => [1, 2, 3]Belt::last([1, 2, 3], 2) // => [2, 3]

Project homepage:Http://www.open-open.com/lib/view/home/1430832041179

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.