Skip to content

Latest commit

 

History

History
36 lines (25 loc) · 526 Bytes

has.mdown

File metadata and controls

36 lines (25 loc) · 526 Bytes

\MyProject\LolitaFramework\Core\Arr::has

The Arr::has function checks that a given item exists in an array using "dot" notation.

Example usage

$array = ['products' => ['desk' => ['price' => 100]]];

$hasDesk = Arr::has($array, 'products.desk');

// true
$array1 = [
    ['id' => 1, 'name' => 'John Doe'],
    ['id' => 2, 'name' => 'Jane Doe']
];

$result = Arr::has($array1, '2.name');

// false

Parameters

\ArrayAccess|array $array

string $key

Return Value

bool