Documentation

XLookup extends LookupBase
in package

Table of Contents

Methods

lookup()  : mixed
XLOOKUP — PHP emulation of Excel's XLOOKUP function.
checkMatch()  : int|null
validateIndexLookup()  : int
validateLookupArray()  : void

Methods

lookup()

XLOOKUP — PHP emulation of Excel's XLOOKUP function.

public static lookup(mixed $lookupValue, mixed $lookupArray, mixed $returnArray[, mixed $ifNotFound = '#N/A!' ][, mixed $matchMode = 0 ][, mixed $searchMode = 1 ]) : mixed
Parameters
$lookupValue : mixed

Value to search for

$lookupArray : mixed

Expect array, Array to search in

$returnArray : mixed

Expect array, Array to return from (must match lookupArray size)

$ifNotFound : mixed = '#N/A!'

Value to return if no match found (default: #N/A!)

$matchMode : mixed = 0

expect int 0 = exact match (default) -1 = exact or next smaller 1 = exact or next larger 2 = wildcard match (* ? ~)

$searchMode : mixed = 1

expect int 1 = first to last (default) -1 = last to first 2 = binary search ascending -2 = binary search descending

checkMatch()

protected static checkMatch(bool $bothNumeric, bool $bothNotNumeric, bool $notExactMatch, int $rowKey, string $cellDataLower, string $lookupLower, int|null $rowNumber) : int|null
Parameters
$bothNumeric : bool
$bothNotNumeric : bool
$notExactMatch : bool
$rowKey : int
$cellDataLower : string
$lookupLower : string
$rowNumber : int|null
Return values
int|null

validateIndexLookup()

protected static validateIndexLookup(array<string|int, mixed> $lookupArray, float|int|string $index_number) : int
Parameters
$lookupArray : array<string|int, mixed>
$index_number : float|int|string

number >= 1

Return values
int

validateLookupArray()

protected static validateLookupArray(mixed $lookupArray) : void
Parameters
$lookupArray : mixed

        
On this page

Search results