nahid / jsonq

A PHP query builder for JSON

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Contains Condition is Case-Sensitive

princeryansy opened this issue · comments

Suggestion to convert strpos to stripos if possible. Thanks!

image

+1 for me.

We had the same issue - but simply extended the class - and made a macro.

``<?php

use Nahid\JsonQ\Jsonq;

class Json_Query extends Jsonq {

public function __construct($jsonFile = null) {
parent::__construct($jsonFile);
$this->macro('containsInsensitive', function($value, $comparable) {
return (stripos($value, $comparable) !== false);
});
}

}