从对象数组中获取值

发布于 2024-10-31 02:26:57 字数 13008 浏览 0 评论 0原文

更新,解决了

我尝试检索对象的值(stdClass) 我想获得实习机会,他的名字是title

(["title"]=> string(53) "Mss ( Privaatpraktijk kinesitherapie Walravens Marc )").

我的代码:

foreach($gStartPositionStudents as $value) {
        foreach($gStartPositionInternships as $value2) {
            // each loop will add a row here.
            $row = array();
            // build the row
            $row[] = array('data' => $value->field_ugentid_student[0]['value']);
            $row[] = array('data' => $value2->title[0]['value']);
        }
        // add the row to the "big row data (contains all rows)
        $rows[] = array('data' => $row);
    }
    $output = theme('table', $header, $rows);
    return $output;

对象数组:

enter code here
array(148) {
  [0]=>
  object(stdClass)#466 (45) {
    ["nid"]=>
    string(3) "199"
    ["type"]=>
    string(11) "stageplaats"
    ["language"]=>
    string(2) "nl"
    ["uid"]=>
    string(2) "33"
    ["status"]=>
    string(1) "1"
    ["created"]=>
    string(10) "1291279334"
    ["changed"]=>
    string(10) "1301323146"
    ["comment"]=>
    string(1) "0"
    ["promote"]=>
    string(1) "0"
    ["moderate"]=>
    string(1) "0"
    ["sticky"]=>
    string(1) "0"
    ["tnid"]=>
    string(1) "0"
    ["translate"]=>
    string(1) "0"
    ["vid"]=>
    string(3) "206"
    ["revision_uid"]=>
    string(2) "16"
    ["title"]=>
    string(18) "Pcv (campus Aalst)"
    ["body"]=>
    string(0) ""
    ["teaser"]=>
    string(0) ""
    ["log"]=>
    string(0) ""
    ["revision_timestamp"]=>
    string(10) "1301323146"
    ["format"]=>
    string(1) "0"
    ["nd_switch_bm"]=>
    string(0) ""
    ["name"]=>
    string(12) "stage.revaki"
    ["picture"]=>
    string(0) ""
    ["data"]=>
    string(72) "a:1:{s:13:"form_build_id";s:37:"form-f89b99e4a5249b192ff472579b826b00";}"
    ["field_stagedomein_audiologo"]=>
    array(1) {
      [0]=>
      array(1) {
        ["value"]=>
        NULL
      }
    }
    ["field_stagedomein_geneeskunde"]=>
    array(1) {
      [0]=>
      array(1) {
        ["value"]=>
        NULL
      }
    }
    ["field_stagedomein_lo"]=>
    array(1) {
      [0]=>
      array(1) {
        ["value"]=>
        NULL
      }
    }
    ["field_stagedomein_revaki"]=>
    array(1) {
      [0]=>
      array(1) {
        ["value"]=>
        string(3) "152"
      }
    }
    ["field_stagedomein_verpleeg"]=>
    array(1) {
      [0]=>
      array(1) {
        ["value"]=>
        NULL
      }
    }
    ["field_status"]=>
    array(1) {
      [0]=>
      array(1) {
        ["value"]=>
        string(14) "niet opgegeven"
      }
    }
    ["field_status_datum"]=>
    array(1) {
      [0]=>
      array(4) {
        ["value"]=>
        NULL
        ["timezone"]=>
        string(15) "Europe/Brussels"
        ["timezone_db"]=>
        string(15) "Europe/Brussels"
        ["date_type"]=>
        string(4) "date"
      }
    }
    ["field_locatieview"]=>
    array(1) {
      [0]=>
      array(1) {
        ["nid"]=>
        string(3) "179"
      }
    }
    ["field_status_extra"]=>
    array(1) {
      [0]=>
      array(1) {
        ["value"]=>
        NULL
      }
    }
    ["field_status_stagedomein"]=>
    array(1) {
      [0]=>
      array(1) {
        ["value"]=>
        string(6) "Actief"
      }
    }
    ["field_maxcapstud_stagedomein"]=>
    array(1) {
      [0]=>
      array(1) {
        ["value"]=>
        string(2) "18"
      }
    }
    ["field_status_bevestigd_door"]=>
    array(1) {
      [0]=>
      array(1) {
        ["nid"]=>
        NULL
      }
    }
    ["field_aanpers_stageplaats"]=>
    array(1) {
      [0]=>
      array(1) {
        ["nid"]=>
        NULL
      }
    }
    ["field_extrainfo_stagedomein"]=>
    array(1) {
      [0]=>
      array(2) {
        ["value"]=>
        string(37) "Capaciteit: 3 studenten alle periodes"
        ["format"]=>
        NULL
      }
    }
    ["field_percapaciteit_stageplaats"]=>
    array(1) {
      [0]=>
      array(1) {
        ["value"]=>
        NULL
      }
    }
    ["field_aanplaats_stageplaats"]=>
    array(1) {
      [0]=>
      array(1) {
        ["value"]=>
        NULL
      }
    }
    ["field_mentoren"]=>
    array(1) {
      [0]=>
      array(1) {
        ["nid"]=>
        string(3) "178"
      }
    }
    ["field_persoon_stagedomein"]=>
    array(1) {
      [0]=>
      array(1) {
        ["nid"]=>
        NULL
      }
    }
    ["has_body"]=>
    string(1) "0"
    ["taxonomy"]=>
    array(0) {
    }
  }
  [1]=>
  object(stdClass)#469 (45) {
    ["nid"]=>
    string(3) "211"
    ["type"]=>
    string(11) "stageplaats"
    ["language"]=>
    string(2) "nl"
    ["uid"]=>
    string(2) "33"
    ["status"]=>
    string(1) "1"
    ["created"]=>
    string(10) "1291281467"
    ["changed"]=>
    string(10) "1301323440"
    ["comment"]=>
    string(1) "0"
    ["promote"]=>
    string(1) "0"
    ["moderate"]=>
    string(1) "0"
    ["sticky"]=>
    string(1) "0"
    ["tnid"]=>
    string(1) "0"
    ["translate"]=>
    string(1) "0"
    ["vid"]=>
    string(3) "218"
    ["revision_uid"]=>
    string(2) "16"
    ["title"]=>
    string(53) "Mss ( Privaatpraktijk kinesitherapie Walravens Marc )"
    ["body"]=>
    string(0) ""
    ["teaser"]=>
    string(0) ""
    ["log"]=>
    string(0) ""
    ["revision_timestamp"]=>
    string(10) "1301323440"
    ["format"]=>
    string(1) "0"
    ["nd_switch_bm"]=>
    string(0) ""
    ["name"]=>
    string(12) "stage.revaki"
    ["picture"]=>
    string(0) ""
    ["data"]=>
    string(72) "a:1:{s:13:"form_build_id";s:37:"form-f89b99e4a5249b192ff472579b826b00";}"
    ["field_stagedomein_audiologo"]=>
    array(1) {
      [0]=>
      array(1) {
        ["value"]=>
        NULL
      }
    }
    ["field_stagedomein_geneeskunde"]=>
    array(1) {
      [0]=>
      array(1) {
        ["value"]=>
        NULL
      }
    }
    ["field_stagedomein_lo"]=>
    array(1) {
      [0]=>
      array(1) {
        ["value"]=>
        NULL
      }
    }
    ["field_stagedomein_revaki"]=>
    array(1) {
      [0]=>
      array(1) {
        ["value"]=>
        string(3) "128"
      }
    }
    ["field_stagedomein_verpleeg"]=>
    array(1) {
      [0]=>
      array(1) {
        ["value"]=>
        NULL
      }
    }
    ["field_status"]=>
    array(1) {
      [0]=>
      array(1) {
        ["value"]=>
        string(14) "niet opgegeven"
      }
    }
    ["field_status_datum"]=>
    array(1) {
      [0]=>
      array(4) {
        ["value"]=>
        NULL
        ["timezone"]=>
        string(15) "Europe/Brussels"
        ["timezone_db"]=>
        string(15) "Europe/Brussels"
        ["date_type"]=>
        string(4) "date"
      }
    }
    ["field_locatieview"]=>
    array(1) {
      [0]=>
      array(1) {
        ["nid"]=>
        string(3) "210"
      }
    }
    ["field_status_extra"]=>
    array(1) {
      [0]=>
      array(1) {
        ["value"]=>
        NULL
      }
    }
    ["field_status_stagedomein"]=>
    array(1) {
      [0]=>
      array(1) {
        ["value"]=>
        string(6) "Actief"
      }
    }
    ["field_maxcapstud_stagedomein"]=>
    array(1) {
      [0]=>
      array(1) {
        ["value"]=>
        string(1) "4"
      }
    }
    ["field_status_bevestigd_door"]=>
    array(1) {
      [0]=>
      array(1) {
        ["nid"]=>
        NULL
      }
    }
    ["field_aanpers_stageplaats"]=>
    array(1) {
      [0]=>
      array(1) {
        ["nid"]=>
        NULL
      }
    }
    ["field_extrainfo_stagedomein"]=>
    array(1) {
      [0]=>
      array(2) {
        ["value"]=>
        string(40) "Capaciteit: 1 student in periode 3 tem 6"
        ["format"]=>
        NULL
      }
    }
    ["field_percapaciteit_stageplaats"]=>
    array(1) {
      [0]=>
      array(1) {
        ["value"]=>
        NULL
      }
    }
    ["field_aanplaats_stageplaats"]=>
    array(1) {
      [0]=>
      array(1) {
        ["value"]=>
        NULL
      }
    }
    ["field_mentoren"]=>
    array(1) {
      [0]=>
      array(1) {
        ["nid"]=>
        string(3) "208"
      }
    }
    ["field_persoon_stagedomein"]=>
    array(1) {
      [0]=>
      array(1) {
        ["nid"]=>
        NULL
      }
    }
    ["has_body"]=>
    string(1) "0"
    ["taxonomy"]=>
    array(0) {
    }
  }
  [2]=>
  object(stdClass)#472 (45) {
    ["nid"]=>
    string(3) "217"
    ["type"]=>
    string(11) "stageplaats"
    ["language"]=>
    string(2) "nl"
    ["uid"]=>
    string(2) "33"
    ["status"]=>
    string(1) "1"
    ["created"]=>
    string(10) "1291281906"
    ["changed"]=>
    string(10) "1301323440"
    ["comment"]=>
    string(1) "0"
    ["promote"]=>
    string(1) "0"
    ["moderate"]=>
    string(1) "0"
    ["sticky"]=>
    string(1) "0"
    ["tnid"]=>
    string(1) "0"
    ["translate"]=>
    string(1) "0"
    ["vid"]=>
    string(3) "224"
    ["revision_uid"]=>
    string(2) "16"
    ["title"]=>
    string(54) "Mss ( Privaatpraktijk kinesitherapie Peeters Stefaan )"
    ["body"]=>
    string(0) ""
    ["teaser"]=>
    string(0) ""
    ["log"]=>
    string(0) ""
    ["revision_timestamp"]=>
    string(10) "1301323440"
    ["format"]=>
    string(1) "0"
    ["nd_switch_bm"]=>
    string(0) ""
    ["name"]=>
    string(12) "stage.revaki"
    ["picture"]=>
    string(0) ""
    ["data"]=>
    string(72) "a:1:{s:13:"form_build_id";s:37:"form-f89b99e4a5249b192ff472579b826b00";}"
    ["field_stagedomein_audiologo"]=>
    array(1) {
      [0]=>
      array(1) {
        ["value"]=>
        NULL
      }
    }
    ["field_stagedomein_geneeskunde"]=>
    array(1) {
      [0]=>
      array(1) {
        ["value"]=>
        NULL
      }
    }
    ["field_stagedomein_lo"]=>
    array(1) {
      [0]=>
      array(1) {
        ["value"]=>
        NULL
      }
    }
    ["field_stagedomein_revaki"]=>
    array(1) {
      [0]=>
      array(1) {
        ["value"]=>
        string(3) "128"
      }
    }
    ["field_stagedomein_verpleeg"]=>
    array(1) {
      [0]=>
      array(1) {
        ["value"]=>
        NULL
      }
    }
    ["field_status"]=>
    array(1) {
      [0]=>
      array(1) {
        ["value"]=>
        string(14) "niet opgegeven"
      }
    }
    ["field_status_datum"]=>
    array(1) {
      [0]=>
      array(4) {
        ["value"]=>
        NULL
        ["timezone"]=>
        string(15) "Europe/Brussels"
        ["timezone_db"]=>
        string(15) "Europe/Brussels"
        ["date_type"]=>
        string(4) "date"
      }
    }
    ["field_locatieview"]=>
    array(1) {
      [0]=>
      array(1) {
        ["nid"]=>
        string(3) "213"
      }
    }
    ["field_status_extra"]=>
    array(1) {
      [0]=>
      array(1) {
        ["value"]=>
        NULL
      }
    }
    ["field_status_stagedomein"]=>
    array(1) {
      [0]=>
      array(1) {
        ["value"]=>
        string(6) "Actief"
      }
    }
    ["field_maxcapstud_stagedomein"]=>
    array(1) {
      [0]=>
      array(1) {
        ["value"]=>
        string(1) "6"
      }
    }
    ["field_status_bevestigd_door"]=>
    array(1) {
      [0]=>
      array(1) {
        ["nid"]=>
        NULL
      }
    }
    ["field_aanpers_stageplaats"]=>
    array(1) {
      [0]=>
      array(1) {
        ["nid"]=>
        NULL
      }
    }
    ["field_extrainfo_stagedomein"]=>
    array(1) {
      [0]=>
      array(2) {
        ["value"]=>
        string(38) "Capaciteit: 1 student in alle periodes"
        ["format"]=>
        NULL
      }
    }
    ["field_percapaciteit_stageplaats"]=>
    array(1) {
      [0]=>
      array(1) {
        ["value"]=>
        NULL
      }
    }
    ["field_aanplaats_stageplaats"]=>
    array(1) {
      [0]=>
      array(1) {
        ["value"]=>
        NULL
      }
    }
    ["field_mentoren"]=>
    array(1) {
      [0]=>
      array(1) {
        ["nid"]=>
        string(3) "214"
      }
    }
    ["field_persoon_stagedomein"]=>
    array(2) {
      [0]=>
      array(1) {
        ["nid"]=>
        string(3) "216"
      }
      [1]=>
      array(1) {
        ["nid"]=>
        string(3) "215"
      }
    }
    ["has_body"]=>
    string(1) "0"
    ["taxonomy"]=>
    array(0) {
    }
  }

Update, solved

I try to retrieve the value of an object (stdClass)
I want to get the internship his name the title.

(["title"]=> string(53) "Mss ( Privaatpraktijk kinesitherapie Walravens Marc )").

My code:

foreach($gStartPositionStudents as $value) {
        foreach($gStartPositionInternships as $value2) {
            // each loop will add a row here.
            $row = array();
            // build the row
            $row[] = array('data' => $value->field_ugentid_student[0]['value']);
            $row[] = array('data' => $value2->title[0]['value']);
        }
        // add the row to the "big row data (contains all rows)
        $rows[] = array('data' => $row);
    }
    $output = theme('table', $header, $rows);
    return $output;

Object array:

enter code here
array(148) {
  [0]=>
  object(stdClass)#466 (45) {
    ["nid"]=>
    string(3) "199"
    ["type"]=>
    string(11) "stageplaats"
    ["language"]=>
    string(2) "nl"
    ["uid"]=>
    string(2) "33"
    ["status"]=>
    string(1) "1"
    ["created"]=>
    string(10) "1291279334"
    ["changed"]=>
    string(10) "1301323146"
    ["comment"]=>
    string(1) "0"
    ["promote"]=>
    string(1) "0"
    ["moderate"]=>
    string(1) "0"
    ["sticky"]=>
    string(1) "0"
    ["tnid"]=>
    string(1) "0"
    ["translate"]=>
    string(1) "0"
    ["vid"]=>
    string(3) "206"
    ["revision_uid"]=>
    string(2) "16"
    ["title"]=>
    string(18) "Pcv (campus Aalst)"
    ["body"]=>
    string(0) ""
    ["teaser"]=>
    string(0) ""
    ["log"]=>
    string(0) ""
    ["revision_timestamp"]=>
    string(10) "1301323146"
    ["format"]=>
    string(1) "0"
    ["nd_switch_bm"]=>
    string(0) ""
    ["name"]=>
    string(12) "stage.revaki"
    ["picture"]=>
    string(0) ""
    ["data"]=>
    string(72) "a:1:{s:13:"form_build_id";s:37:"form-f89b99e4a5249b192ff472579b826b00";}"
    ["field_stagedomein_audiologo"]=>
    array(1) {
      [0]=>
      array(1) {
        ["value"]=>
        NULL
      }
    }
    ["field_stagedomein_geneeskunde"]=>
    array(1) {
      [0]=>
      array(1) {
        ["value"]=>
        NULL
      }
    }
    ["field_stagedomein_lo"]=>
    array(1) {
      [0]=>
      array(1) {
        ["value"]=>
        NULL
      }
    }
    ["field_stagedomein_revaki"]=>
    array(1) {
      [0]=>
      array(1) {
        ["value"]=>
        string(3) "152"
      }
    }
    ["field_stagedomein_verpleeg"]=>
    array(1) {
      [0]=>
      array(1) {
        ["value"]=>
        NULL
      }
    }
    ["field_status"]=>
    array(1) {
      [0]=>
      array(1) {
        ["value"]=>
        string(14) "niet opgegeven"
      }
    }
    ["field_status_datum"]=>
    array(1) {
      [0]=>
      array(4) {
        ["value"]=>
        NULL
        ["timezone"]=>
        string(15) "Europe/Brussels"
        ["timezone_db"]=>
        string(15) "Europe/Brussels"
        ["date_type"]=>
        string(4) "date"
      }
    }
    ["field_locatieview"]=>
    array(1) {
      [0]=>
      array(1) {
        ["nid"]=>
        string(3) "179"
      }
    }
    ["field_status_extra"]=>
    array(1) {
      [0]=>
      array(1) {
        ["value"]=>
        NULL
      }
    }
    ["field_status_stagedomein"]=>
    array(1) {
      [0]=>
      array(1) {
        ["value"]=>
        string(6) "Actief"
      }
    }
    ["field_maxcapstud_stagedomein"]=>
    array(1) {
      [0]=>
      array(1) {
        ["value"]=>
        string(2) "18"
      }
    }
    ["field_status_bevestigd_door"]=>
    array(1) {
      [0]=>
      array(1) {
        ["nid"]=>
        NULL
      }
    }
    ["field_aanpers_stageplaats"]=>
    array(1) {
      [0]=>
      array(1) {
        ["nid"]=>
        NULL
      }
    }
    ["field_extrainfo_stagedomein"]=>
    array(1) {
      [0]=>
      array(2) {
        ["value"]=>
        string(37) "Capaciteit: 3 studenten alle periodes"
        ["format"]=>
        NULL
      }
    }
    ["field_percapaciteit_stageplaats"]=>
    array(1) {
      [0]=>
      array(1) {
        ["value"]=>
        NULL
      }
    }
    ["field_aanplaats_stageplaats"]=>
    array(1) {
      [0]=>
      array(1) {
        ["value"]=>
        NULL
      }
    }
    ["field_mentoren"]=>
    array(1) {
      [0]=>
      array(1) {
        ["nid"]=>
        string(3) "178"
      }
    }
    ["field_persoon_stagedomein"]=>
    array(1) {
      [0]=>
      array(1) {
        ["nid"]=>
        NULL
      }
    }
    ["has_body"]=>
    string(1) "0"
    ["taxonomy"]=>
    array(0) {
    }
  }
  [1]=>
  object(stdClass)#469 (45) {
    ["nid"]=>
    string(3) "211"
    ["type"]=>
    string(11) "stageplaats"
    ["language"]=>
    string(2) "nl"
    ["uid"]=>
    string(2) "33"
    ["status"]=>
    string(1) "1"
    ["created"]=>
    string(10) "1291281467"
    ["changed"]=>
    string(10) "1301323440"
    ["comment"]=>
    string(1) "0"
    ["promote"]=>
    string(1) "0"
    ["moderate"]=>
    string(1) "0"
    ["sticky"]=>
    string(1) "0"
    ["tnid"]=>
    string(1) "0"
    ["translate"]=>
    string(1) "0"
    ["vid"]=>
    string(3) "218"
    ["revision_uid"]=>
    string(2) "16"
    ["title"]=>
    string(53) "Mss ( Privaatpraktijk kinesitherapie Walravens Marc )"
    ["body"]=>
    string(0) ""
    ["teaser"]=>
    string(0) ""
    ["log"]=>
    string(0) ""
    ["revision_timestamp"]=>
    string(10) "1301323440"
    ["format"]=>
    string(1) "0"
    ["nd_switch_bm"]=>
    string(0) ""
    ["name"]=>
    string(12) "stage.revaki"
    ["picture"]=>
    string(0) ""
    ["data"]=>
    string(72) "a:1:{s:13:"form_build_id";s:37:"form-f89b99e4a5249b192ff472579b826b00";}"
    ["field_stagedomein_audiologo"]=>
    array(1) {
      [0]=>
      array(1) {
        ["value"]=>
        NULL
      }
    }
    ["field_stagedomein_geneeskunde"]=>
    array(1) {
      [0]=>
      array(1) {
        ["value"]=>
        NULL
      }
    }
    ["field_stagedomein_lo"]=>
    array(1) {
      [0]=>
      array(1) {
        ["value"]=>
        NULL
      }
    }
    ["field_stagedomein_revaki"]=>
    array(1) {
      [0]=>
      array(1) {
        ["value"]=>
        string(3) "128"
      }
    }
    ["field_stagedomein_verpleeg"]=>
    array(1) {
      [0]=>
      array(1) {
        ["value"]=>
        NULL
      }
    }
    ["field_status"]=>
    array(1) {
      [0]=>
      array(1) {
        ["value"]=>
        string(14) "niet opgegeven"
      }
    }
    ["field_status_datum"]=>
    array(1) {
      [0]=>
      array(4) {
        ["value"]=>
        NULL
        ["timezone"]=>
        string(15) "Europe/Brussels"
        ["timezone_db"]=>
        string(15) "Europe/Brussels"
        ["date_type"]=>
        string(4) "date"
      }
    }
    ["field_locatieview"]=>
    array(1) {
      [0]=>
      array(1) {
        ["nid"]=>
        string(3) "210"
      }
    }
    ["field_status_extra"]=>
    array(1) {
      [0]=>
      array(1) {
        ["value"]=>
        NULL
      }
    }
    ["field_status_stagedomein"]=>
    array(1) {
      [0]=>
      array(1) {
        ["value"]=>
        string(6) "Actief"
      }
    }
    ["field_maxcapstud_stagedomein"]=>
    array(1) {
      [0]=>
      array(1) {
        ["value"]=>
        string(1) "4"
      }
    }
    ["field_status_bevestigd_door"]=>
    array(1) {
      [0]=>
      array(1) {
        ["nid"]=>
        NULL
      }
    }
    ["field_aanpers_stageplaats"]=>
    array(1) {
      [0]=>
      array(1) {
        ["nid"]=>
        NULL
      }
    }
    ["field_extrainfo_stagedomein"]=>
    array(1) {
      [0]=>
      array(2) {
        ["value"]=>
        string(40) "Capaciteit: 1 student in periode 3 tem 6"
        ["format"]=>
        NULL
      }
    }
    ["field_percapaciteit_stageplaats"]=>
    array(1) {
      [0]=>
      array(1) {
        ["value"]=>
        NULL
      }
    }
    ["field_aanplaats_stageplaats"]=>
    array(1) {
      [0]=>
      array(1) {
        ["value"]=>
        NULL
      }
    }
    ["field_mentoren"]=>
    array(1) {
      [0]=>
      array(1) {
        ["nid"]=>
        string(3) "208"
      }
    }
    ["field_persoon_stagedomein"]=>
    array(1) {
      [0]=>
      array(1) {
        ["nid"]=>
        NULL
      }
    }
    ["has_body"]=>
    string(1) "0"
    ["taxonomy"]=>
    array(0) {
    }
  }
  [2]=>
  object(stdClass)#472 (45) {
    ["nid"]=>
    string(3) "217"
    ["type"]=>
    string(11) "stageplaats"
    ["language"]=>
    string(2) "nl"
    ["uid"]=>
    string(2) "33"
    ["status"]=>
    string(1) "1"
    ["created"]=>
    string(10) "1291281906"
    ["changed"]=>
    string(10) "1301323440"
    ["comment"]=>
    string(1) "0"
    ["promote"]=>
    string(1) "0"
    ["moderate"]=>
    string(1) "0"
    ["sticky"]=>
    string(1) "0"
    ["tnid"]=>
    string(1) "0"
    ["translate"]=>
    string(1) "0"
    ["vid"]=>
    string(3) "224"
    ["revision_uid"]=>
    string(2) "16"
    ["title"]=>
    string(54) "Mss ( Privaatpraktijk kinesitherapie Peeters Stefaan )"
    ["body"]=>
    string(0) ""
    ["teaser"]=>
    string(0) ""
    ["log"]=>
    string(0) ""
    ["revision_timestamp"]=>
    string(10) "1301323440"
    ["format"]=>
    string(1) "0"
    ["nd_switch_bm"]=>
    string(0) ""
    ["name"]=>
    string(12) "stage.revaki"
    ["picture"]=>
    string(0) ""
    ["data"]=>
    string(72) "a:1:{s:13:"form_build_id";s:37:"form-f89b99e4a5249b192ff472579b826b00";}"
    ["field_stagedomein_audiologo"]=>
    array(1) {
      [0]=>
      array(1) {
        ["value"]=>
        NULL
      }
    }
    ["field_stagedomein_geneeskunde"]=>
    array(1) {
      [0]=>
      array(1) {
        ["value"]=>
        NULL
      }
    }
    ["field_stagedomein_lo"]=>
    array(1) {
      [0]=>
      array(1) {
        ["value"]=>
        NULL
      }
    }
    ["field_stagedomein_revaki"]=>
    array(1) {
      [0]=>
      array(1) {
        ["value"]=>
        string(3) "128"
      }
    }
    ["field_stagedomein_verpleeg"]=>
    array(1) {
      [0]=>
      array(1) {
        ["value"]=>
        NULL
      }
    }
    ["field_status"]=>
    array(1) {
      [0]=>
      array(1) {
        ["value"]=>
        string(14) "niet opgegeven"
      }
    }
    ["field_status_datum"]=>
    array(1) {
      [0]=>
      array(4) {
        ["value"]=>
        NULL
        ["timezone"]=>
        string(15) "Europe/Brussels"
        ["timezone_db"]=>
        string(15) "Europe/Brussels"
        ["date_type"]=>
        string(4) "date"
      }
    }
    ["field_locatieview"]=>
    array(1) {
      [0]=>
      array(1) {
        ["nid"]=>
        string(3) "213"
      }
    }
    ["field_status_extra"]=>
    array(1) {
      [0]=>
      array(1) {
        ["value"]=>
        NULL
      }
    }
    ["field_status_stagedomein"]=>
    array(1) {
      [0]=>
      array(1) {
        ["value"]=>
        string(6) "Actief"
      }
    }
    ["field_maxcapstud_stagedomein"]=>
    array(1) {
      [0]=>
      array(1) {
        ["value"]=>
        string(1) "6"
      }
    }
    ["field_status_bevestigd_door"]=>
    array(1) {
      [0]=>
      array(1) {
        ["nid"]=>
        NULL
      }
    }
    ["field_aanpers_stageplaats"]=>
    array(1) {
      [0]=>
      array(1) {
        ["nid"]=>
        NULL
      }
    }
    ["field_extrainfo_stagedomein"]=>
    array(1) {
      [0]=>
      array(2) {
        ["value"]=>
        string(38) "Capaciteit: 1 student in alle periodes"
        ["format"]=>
        NULL
      }
    }
    ["field_percapaciteit_stageplaats"]=>
    array(1) {
      [0]=>
      array(1) {
        ["value"]=>
        NULL
      }
    }
    ["field_aanplaats_stageplaats"]=>
    array(1) {
      [0]=>
      array(1) {
        ["value"]=>
        NULL
      }
    }
    ["field_mentoren"]=>
    array(1) {
      [0]=>
      array(1) {
        ["nid"]=>
        string(3) "214"
      }
    }
    ["field_persoon_stagedomein"]=>
    array(2) {
      [0]=>
      array(1) {
        ["nid"]=>
        string(3) "216"
      }
      [1]=>
      array(1) {
        ["nid"]=>
        string(3) "215"
      }
    }
    ["has_body"]=>
    string(1) "0"
    ["taxonomy"]=>
    array(0) {
    }
  }

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

给不了的爱 2024-11-07 02:26:57

嗯,据我所知,您实际上已将一个数组分配给对象中的众多变量。因此,您需要在 foreach 循环中执行类似的操作:

global $gStartPositionStudents;
global $gStartPositionInternships;
$rows = array();
foreach($gStartPositionStudents as $value) {
    // each loop will add a row here.
    $row = array();
    // build the row
    $row[] = array('data' => $value->field_naam_student[0]['value']);
    $row[] = array('data' => $gStartPositionInternships->field_stagedomein_revaki);
    // add the row to the "big row data (contains all rows)
    $rows[] = array('data' => $row);
}
$output = theme('table', $header, $rows);
return $output;

Well, as far as I can tell, you've actually assigned an array to the numerous variables in the object. As a result, you will need to do something like this in your foreach loop:

global $gStartPositionStudents;
global $gStartPositionInternships;
$rows = array();
foreach($gStartPositionStudents as $value) {
    // each loop will add a row here.
    $row = array();
    // build the row
    $row[] = array('data' => $value->field_naam_student[0]['value']);
    $row[] = array('data' => $gStartPositionInternships->field_stagedomein_revaki);
    // add the row to the "big row data (contains all rows)
    $rows[] = array('data' => $row);
}
$output = theme('table', $header, $rows);
return $output;
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文