Hi how would I make a Json combined And OR statement. Like to search om year = 2018 AND datatype is Budget OR Forecast, below fails and all other stuff I tried 🙂
$sarr = <<< SEARCH_JSON
{
“groupOp”:”And”,
“rules”:
[
{“field”:”FCYear”,”op”:”eq”,”data”:”{$defaultyear}”},
{“field”:”Datatype”,”op”:”eq”,”data”:”Forecast” ||
“field”:”Datatype”,”op”:”eq”,”data”:”Budget”}
]
}
2 Answers
Search JSON for complex conditions, demo code here:
https://gist.github.com/gridphp/9122f2727d6b60fdf33ee75a11404036
Your Answer