2017 © Pedro Peláez
 

library in-arrays

Checks if a value exists in an array of arrays

image

jstewmc/in-arrays

Checks if a value exists in an array of arrays

  • Saturday, August 27, 2016
  • by Jstewmc
  • Repository
  • 1 Watchers
  • 0 Stars
  • 5 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

in-arrays

Checks if a value exists in an array of arrays., (*1)

use Jstewmc\InArrays\In;

$arrays = [
    'foo' => ['foo', 'bar', 'baz'],
    'bar' => ['foo', 'bar', 'baz']
];

$service = new In($arrays);

$service('foo', 'foo');  // returns true
$service('bar', 'foo');  // returns true
$service('bar', 'qux');  // returns false (value "qux" does not exist)
$service('baz', 'foo');  // returns false (array "baz" does not exist)

Case-sensitivity

This library, like PHP, uses case-sensitive keys and values., (*2)

For example:, (*3)

use Jstewmc\InArrays\In;

// note the lower-case key and value
$service = new In(['foo' => ['foo']);

$service('foo', 'foo');  // returns true
$service('FOO', 'foo');  // returns false (keys are case-sensitive)
$service('bar', 'FOO');  // returns false (values are case-sensitive)

That's about it!, (*4)

Author

Jack Clayton, (*5)

License

MIT, (*6)

Version

0.1.0, August 27, 2016

  • Initial release

The Versions

27/08 2016

dev-master

9999999-dev

Checks if a value exists in an array of arrays

  Sources   Download

The Requires

  • php ^7.0

 

The Development Requires

by Jack Clayton

php array in jstewmc

27/08 2016

v0.1.0

0.1.0.0

Checks if a value exists in an array of arrays

  Sources   Download

The Requires

  • php ^7.0

 

The Development Requires

by Jack Clayton

php array in jstewmc