在stdClass对象变量中进行多重搜索?

时间:2018-06-01 09:39:11

标签: php arrays object stdclass

我正在用JSON设计一个数据库系统(php类),我想在变量Object stdClass中做一个多标准搜索功能(单个标准没问题),我被阻止了: - (

import java.util.Scanner;

public class NestedIf {

public static void main(String[] args) {


    Scanner iqInput=new Scanner(System.in);
    System.out.println("Please enter your IQ: ");
    iqInput.nextDouble();


    Scanner termMeanInput=new Scanner(System.in);
    System.out.println("Please enter your term mean: ");
    termMeanInput.nextDouble();


    if(iqInput.hasNextDouble() && termMeanInput.hasNextDouble()){

        if(iqInput.nextDouble()>110 && termMeanInput.nextDouble()>18){
            System.out.println("You got 30 percent discount.");

        }else if(iqInput.nextDouble()>100 && termMeanInput.nextDouble()>17){
            System.out.println("You got 20 percent discount.");

        }else if(iqInput.nextDouble()<100 && termMeanInput.nextDouble()<17){
            System.out.println("You have no discount");
        }
    }else{
        System.out.println("Please enter the right format");
    }
}

}

对于我创建了一个php类的系统,这里是用单个条件搜索的功能

Array ( [0] => stdClass Object ( [id] => 1 [Deliveredon] => 04-30-2018 9:18 pm [Projectid] => 11201 [Title] => xxx[Client] => xxxx => [Orderby] => xxx [Editor] => xxx [Version] => 0.1 [Type] => Creation [Createdon] => 04-24-2018 4:00 pm [DateReadytoprocess] => 04-24-2018 4:00 pm [DateProcessing] => 04-30-2018 2:51 pm [Tags] => [Datecourte] => 30-04-2018 [Semaine] => 18 [Mois] => 04 [Annee] => 2018 [Heure] => 9:18 pm ) [1] => stdClass Object ( [id] => 2 [Deliveredon] => 04-30-2018 7:10 pm [Projectid] => 10309 [Title] => xxx [Client] => xxx [Group] => [Orderby] =>xxx [Editor] => xxx [Version] => 2 [Type] => Editing [Createdon] => 03-20-2018 3:42 pm [DateReadytoprocess] => 04-25-2018 2:19 pm [DateProcessing] => [Tags] => [Datecourte] => 30-04-2018 [Semaine] => 18 [Mois] => 04 [Annee] => 2018 [Heure] => 7:10 pm )

我想创建一个类似的函数,但是有一个数组变量参数

你能帮帮我吗?提前谢谢

0 个答案:

没有答案