ICanBoogie
  • Documentation
  • API Reference
  • Common v1.3.0
Namespaces
  • ICanBoogie
Classes
  • FormattedString
Interfaces
  • ToArray
  • ToArrayRecursive
Traits
  • ToArrayRecursiveTrait
Exceptions
  • OffsetError
  • OffsetNotDefined
  • OffsetNotReadable
  • OffsetNotWritable
  • PropertyError
  • PropertyIsReserved
  • PropertyNotDefined
  • PropertyNotReadable
  • PropertyNotWritable
Functions
  • array_flatten
  • array_insert
  • array_merge_recursive
  • capitalize
  • downcase
  • dump
  • escape
  • escape_all
  • exact_array_merge_recursive
  • format
  • generate_v4_uuid
  • normalize
  • normalize_url_path
  • remove_accents
  • shorten
  • sort_by_weight
  • stable_sort
  • unaccent_compare
  • unaccent_compare_ci
  • upcase

Function sort_by_weight

Sort an array according to the weight of its items.

The weight of the items is defined as an integer; a position relative to another member of the array before:<key> or after:<key>; the special words top and bottom.

Namespace: ICanBoogie
Located at helpers.php

Parameters summary

array $array
callable $weight_picker <p>The callback function used to pick the weight of the item. The function is called with the following arguments: <code>$value</code>, <code>$key</code>.</p>

Return value summary

array A sorted copy of the array.
Common v1.3.0 – Check on GitHub – API documentation generated by ApiGen