JSON对象组的值 - PHP

时间:2017-07-17 02:34:48

标签: php arrays json

我正在考虑如何通过具有相同值的对象对数组进行分组 请帮我用这个JSONdata创建搜索表单。

array(1000) {
  [0] =>
  array(2) {
      ["loanGuid"] =>
      string(36)
      "4f6457d5-ea00-401b-ad2d-815ac3454d21" ["fields"] =>
      array(7) {
        ["Fields.745"] =>
        string(21)
        "7/12/2017 12:00:00 AM" ["Loan.LoanFolder"] =>
        string(11)
        "My Pipeline" ["Loan.LoanNumber"] =>
        string(10)
        "1707010957" ["Loan.LastModified"] =>
        string(20)
        "7/14/2017 6:07:14 PM" ["Loan.TPOCompanyName"] =>
        string(14)
        "ABC" ["Fields.Log.MS.LastCompleted"] =>
        string(6)
        "Set Up" ["Fields.Log.MS.Date.Set Up"] =>
        string(21)
        "7/14/2017 12:00:00 AM"
      }
    }
    [1] =>
    array(2) {
      ["loanGuid"] =>
      string(36)
      "f9e39e56-7f64-473f-a8a0-362e16b2aac9" ["fields"] =>
      array(7) {
        ["Fields.745"] =>
        string(21)
        "7/11/2017 12:00:00 AM" ["Loan.LoanFolder"] =>
        string(11)
        "My Pipeline" ["Loan.LoanNumber"] =>
        string(10)
        "1707010931" ["Loan.TPOCompanyName"] =>
        string(14)
        "ABC" ["Fields.Log.MS.LastCompleted"] =>
        string(6)
        "Set Up" ["Fields.Log.MS.Date.Set Up"] =>
        string(21)
        "7/14/2017 12:00:00 AM"
      }
    }
    [2] =>
    array(2) {
      ["loanGuid"] =>
      string(36)
      "7e7ea19f-d024-488f-8d4b-c7a6ff4b9dc3" ["fields"] =>
      array(7) {
        ["Fields.745"] =>
        string(21)
        "7/14/2017 12:00:00 AM" ["Loan.LoanFolder"] =>
        string(11)
        "My Pipeline" ["Loan.LoanNumber"] =>
        string(10)
        "1707010927" ["Loan.TPOCompanyName"] =>
        string(60)
        "BBC" ["Fields.Log.MS.LastCompleted"] =>
        string(6)
        "Set Up" ["Fields.Log.MS.Date.Set Up"] =>
        string(21)
        "7/14/2017 12:00:00 AM"
      }
    }
}

我想按["Loan.TPOCompanyName"]的字段值进行分组 然后,我将能够使用这些值创建搜索表单。

类似的东西:

<select name='TOPCompanyName'> 
  <option value='ABC'>ABC</option> 
  <option value='BBC'>BBC</option> 
</select> 

0 个答案:

没有答案