mirror of
https://github.com/parsecsv/parsecsv-for-php.git
synced 2026-02-19 00:36:38 +00:00
Support to search for numbers
This commit is contained in:
committed by
Fonata
parent
260de6126c
commit
33f0b6aa7c
@@ -1108,6 +1108,8 @@ class Csv {
|
|||||||
'is greater than or equals',
|
'is greater than or equals',
|
||||||
'contains',
|
'contains',
|
||||||
'does not contain',
|
'does not contain',
|
||||||
|
'is number',
|
||||||
|
'is not number',
|
||||||
);
|
);
|
||||||
|
|
||||||
$operators_regex = array();
|
$operators_regex = array();
|
||||||
@@ -1149,6 +1151,10 @@ class Csv {
|
|||||||
$op_equals = in_array($op, ['=', 'equals', 'is'], true);
|
$op_equals = in_array($op, ['=', 'equals', 'is'], true);
|
||||||
if ($op_equals && $row[$field] == $value) {
|
if ($op_equals && $row[$field] == $value) {
|
||||||
return '1';
|
return '1';
|
||||||
|
} elseif ($op_equals && $value == 'number' && is_numeric($row[$field])) {
|
||||||
|
return '1';
|
||||||
|
} elseif (($op == '!=' || $op == 'is not') && $value == 'number' && !is_numeric($row[$field])) {
|
||||||
|
return '1';
|
||||||
} elseif (($op == '!=' || $op == 'is not') && $row[$field] != $value) {
|
} elseif (($op == '!=' || $op == 'is not') && $row[$field] != $value) {
|
||||||
return '1';
|
return '1';
|
||||||
} elseif (($op == '<' || $op == 'is less than') && $row[$field] < $value) {
|
} elseif (($op == '<' || $op == 'is less than') && $row[$field] < $value) {
|
||||||
|
|||||||
Reference in New Issue
Block a user