2017 © Pedro Peláez
 

library array_some

Checks whether some element resp. key in an array passes a test implemented by a callback function.

image

schnittstabil/array_some

Checks whether some element resp. key in an array passes a test implemented by a callback function.

  • Monday, April 11, 2016
  • by schnittstabil
  • Repository
  • 1 Watchers
  • 1 Stars
  • 103 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Schnittstabil\ArraySome Build Status Coverage Status Code Climate

SensioLabsInsight, (*1)

Checks whether some element resp. key in an array passes a test implemented by a callback function, (*2)

Install

$ composer require schnittstabil/array_some

Usage

use function Schnittstabil\ArraySome\array_some;

array_some(['l', 'e', 'e', 't'], 'is_string'); // => true
array_some([ 1,   3,   3,   7 ], 'is_string'); // => false


use function Schnittstabil\ArraySome\array_some_key;

array_some_key(['unicorns' => 24], 'is_string'); // => true
array_some_key([42 => 'unicorns'], 'is_string'); // => false

API

/**
 * Checks whether some element in the array passes the test implemented by the callback function.
 *
 * @param array    $array    The array to iterate over
 * @param callable $callback The callback function to use
 *
 * @return bool
 */
function array_some(array $array, callable $callback);

/**
 * Checks whether some key in the array passes the test implemented by the callback function.
 *
 * @param array    $array    The array to iterate over
 * @param callable $callback The callback function to use
 *
 * @return bool
 */
function array_some_key(array $array, callable $callback);

License

MIT © Michael Mayer, (*3)

The Versions

11/04 2016

dev-master

9999999-dev

Checks whether some element resp. key in an array passes a test implemented by a callback function.

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

The Development Requires

array key element some any exists

11/04 2016

1.0.0

1.0.0.0

Checks whether some element resp. key in an array passes a test implemented by a callback function.

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

The Development Requires

array key element some any exists