print_r($rows)
これを返します:
Array
(
[S1 | Excellence in P-O-P Execution: Ripping Down the Roadblocks to Breakthrough In-Store Marketing] => Array
(
[group] => S1 | Excellence in P-O-P Execution: Ripping Down the Roadblocks to Breakthrough In-Store Marketing
[rows] => Array
(
[0] => stdClass Object
(
[nid] => 207
[node_title] => Excellence in P-O-P Execution: Ripping Down the Roadblocks to Breakthrough In-Store Marketing
[taxonomy_term_data_field_data_field_track_term_tid] => 19
[node_field_data_field_speaker_title] => Jon Kramer
[node_field_data_field_speaker_nid] => 205
[field_data_field_date_time_field_date_time_value] => 2012-10-16 18:00:00
[field_data_field_session_number_field_session_number_value] => S1
[field_data_field_date_time_node_entity_type] => node
[field_data_field_session_number_node_entity_type] => node
[field_data_field_track_icon_taxonomy_term_entity_type] => taxonomy_term
[field_data_field_job_title_node_entity_type] => node
[field_data_field_company_node_entity_type] => node
[field_data_field_hide_track_node_entity_type] => node
(閉じ括弧がすべて欠けていることはわかっています。戻り値は実際には数千行の長さであり、すべてを調べて見つけるのが面倒です。)
nid と呼ばれるデータを取得するにはどうすればよいでしょうか。だろうと思っていた
$rows[0]['rows'][0]->nid
しかし、未定義のオフセット エラーが発生します。完全なコンテンツ (S1 | Excellence など) を使用して配列の最初のレベルにアクセスすることは絶対にできません - これは動的に生成されます。これは配列の最初の要素であるため、ゼロオフセットで取得できると思っていましたが、明らかにそうではありません。
更新しました
current()
以下の回答に従って、いくつかのことを試しました。1 レベル近づきますが、まだ nid 要素にアクセスできません。
$row = current($rows);
$nid_tmp = $row['rows'];
print '<pre>'; var_dump($nid_tmp); print '</pre>';
戻り値
Array
(
[0] => stdClass Object
(
[nid] => 207
罰金; それが私が期待していたことです。しかし、試してみるとprint $nid_tmp[0]->nid
、「通知:オブジェクト以外のプロパティを取得しようとしています」というエラーが表示されます。