...

View Full Version : how to output it?



runeveryday
12-05-2010, 09:28 AM
the print_r($a)'s result is



views_handle_field_node Object

(

[view]=>view Object

(
[db_table] => views_view
[base_table] => node
[args] => Array
(
[0] => My entry 1
)

[use_ajax] =>
[result] => Array
(
[0] => stdClass Object
(
[nid] => 5
[node_title] => Title of a test entry
[node_revisions_body] =>
[node_revisions_format] => 1
[node_vid] => 5
[term_data_name] => My first test term name
[term_data_vid] => 1
[term_data_tid] => 1
[vocabulary_name] => Vocabulary 1
[node_revisions_vid] => 5
)

[1]=> stdClass Object
(
[nid] => 8
[node_title] => Title of a test entry
[node_revisions_body] =>
[node_revisions_format] => 1
[node_vid] => 5
[term_data_name] => My first test term name
[term_data_vid] => 1
[term_data_tid] => 1
[vocabulary_name] => Vocabulary 1
[node_revisions_vid] => 5
..
[2]..
..



now i want to output the [nid]=>5 and[nid]=>8.....and all the nid's value.i use this, but can't work.

$views_handle_field_node->$view->$result[]->nid. what's the correct output of it.

Lamped
12-05-2010, 02:35 PM
foreach($views_handle_field_node->view->result as $node) {
echo($node->nid."\n");
}



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum