method getField documentation in bbn\X

Returns the first value of a specific field of an array that satisfies the where condition.

Example

X::dump(X::getField([[ 'id' => 1, 'name' => 'Andrew', 'fname' => 'Williams' ], [ 'id' => 2, 'name' => 'Albert', 'fname' => 'Taylor' ], [ 'id' => 3, 'name' => 'Mike', 'fname' => 'Smith' ], [ 'id' => 4, 'name' => 'John', 'fname' => 'White' ]], ['name' => 'Albert'],'id')); // int 2 function(array $r, $where, string $field) { if (($res = self::getRow($r, $where)) && isset($res[$field])) { return $res[$field]; } return false; }

Returns the first value of a specific field of an array that satisfies the where condition. BBN is a suite of PHP and JS libraries and VueJS components - all open-source! bbn.io, build applications, the quick way

This website uses cookies to ensure you get the best experience on our website.