Documentation, format class, no modification. (#7628)

This commit is contained in:
frytimo
2025-11-18 21:49:39 -04:00
committed by GitHub
parent adfc4cc469
commit bbe7b9e9b7
37 changed files with 5051 additions and 4144 deletions

View File

@@ -230,6 +230,16 @@
}
//create a function to find matching row in array and return the row or boolean
/**
* Searches for a value in an array and returns the corresponding row or boolean result.
*
* @param array $search_array The array to search in.
* @param string $field The field name to match.
* @param mixed $value The value to search for.
* @param string $type The type of result to return. Can be 'boolean' or 'row'. Defaults to 'boolean'.
*
* @return bool|mixed The found row if $type is 'row', true if the value exists and $type is 'boolean', false otherwise.
*/
function find_in_array($search_array, $field, $value, $type = 'boolean') {
foreach($search_array as $row) {
if ($row[$field] == $value) {